summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-10 14:37:57 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-02-10 14:37:57 (GMT)
commite2619c13f727504b7368e0bf156c17112ee81568 (patch)
treeab0df7233b35770acf1ce7d0d9bde2824cc6419e /Source/cmLocalUnixMakefileGenerator3.cxx
parentc548ddc1724c9c96bab04d2f51d1740360bcb737 (diff)
parentd8639733a42149ca1402dcae427f2142ab0cf037 (diff)
downloadCMake-e2619c13f727504b7368e0bf156c17112ee81568.zip
CMake-e2619c13f727504b7368e0bf156c17112ee81568.tar.gz
CMake-e2619c13f727504b7368e0bf156c17112ee81568.tar.bz2
Merge topic 'use-algorithms'
d8639733 cmSystemTools: Remove unnecessary comparison. 803317aa cmSystemTools: Early return if size makes later comparison false. 11093a03 Replace temporary bool by inlining warning condition. 6cd2ee95 Replace loop with member algorithm. 94e993a0 cmComputeLinkDepends: Remove temporary iterator copy. 69dbe51b Replace loop with algorithm. 683fafea Replace a loop with std::transform. 63f584b6 Replace while loop with member insert. 74c4d9d2 Take a size check outside of an inner loop. 71d47115 Use insert member instead of back_inserter. 39622c99 Convert while loop to member insert. a7fcc148 Convert loop to algorithm. d46c4f07 Extract a prefix variable from loop. d59913f0 Take computation out of loop. 3f3db744 cmMakefile: Remove ExpandSourceListArguments. bd990c80 Remove use of ExpandSourceListArguments. ...
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index c4f7243..54d330f 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2400,14 +2400,10 @@ void cmLocalUnixMakefileGenerator3
// On UNIX we must construct a single shell command to change
// directory and build because make resets the directory between
// each command.
- std::vector<std::string>::iterator i = commands.begin();
- for (; i != commands.end(); ++i)
- {
- std::string cmd = cd_cmd;
- cmd += this->ConvertToOutputForExisting(tgtDir, relRetDir);
- cmd += " && ";
- cmd += *i;
- *i = cmd;
- }
+ std::string outputForExisting =
+ this->ConvertToOutputForExisting(tgtDir, relRetDir);
+ std::string prefix = cd_cmd + outputForExisting + " && ";
+ std::transform(commands.begin(), commands.end(), commands.begin(),
+ std::bind1st(std::plus<std::string>(), prefix));
}
}