summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-27 21:39:46 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-18 22:45:18 (GMT)
commit470cff497bc26d48ee05de0b260af2546bb7698c (patch)
tree03f8052e982544f58ab1d3f9d6902ec767459db5 /Source/cmMakefile.cxx
parente6ca1b82744154fa048634abdc353e4118a11979 (diff)
downloadCMake-470cff497bc26d48ee05de0b260af2546bb7698c.zip
CMake-470cff497bc26d48ee05de0b260af2546bb7698c.tar.gz
CMake-470cff497bc26d48ee05de0b260af2546bb7698c.tar.bz2
cmMakefile: Replace loop with composed algorithm.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ac5fec9..2085a97 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1472,18 +1472,11 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
cmSystemTools::ExpandListArgument(cdefs, defs);
// Recompose the list without the definition.
- std::string ndefs;
- const char* sep = "";
- for(std::vector<std::string>::const_iterator di = defs.begin();
- di != defs.end(); ++di)
- {
- if(*di != define)
- {
- ndefs += sep;
- sep = ";";
- ndefs += *di;
- }
- }
+ std::vector<std::string>::const_iterator defEnd =
+ std::remove(defs.begin(), defs.end(), define);
+ std::vector<std::string>::const_iterator defBegin =
+ defs.begin();
+ std::string ndefs = cmJoin(cmRange(defBegin, defEnd), ";");
// Store the new list.
this->SetProperty("COMPILE_DEFINITIONS", ndefs.c_str());