summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-02-15 18:02:56 +0100
committerStephen Kelly <steveire@gmail.com>2015-02-15 18:57:23 +0100
commit67a26764b536992a966cacab4811c2d30624405c (patch)
treebfc5bfa1226a4b86dde98a165c75e1726d51ac92
parent1cecd3a53107f7f670cf011201c1da3a33b795b6 (diff)
downloadcmake-67a26764b536992a966cacab4811c2d30624405c.tar.gz
cmListCommand: Implement REVERSE subcommand with std::reverse.
-rw-r--r--Source/cmListCommand.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index ae13fdf987..22d8b0e98f 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -410,15 +410,8 @@ bool cmListCommand
return false;
}
- std::string value;
- std::vector<std::string>::reverse_iterator it;
- const char* sep = "";
- for ( it = varArgsExpanded.rbegin(); it != varArgsExpanded.rend(); ++ it )
- {
- value += sep;
- value += it->c_str();
- sep = ";";
- }
+ std::reverse(varArgsExpanded.begin(), varArgsExpanded.end());
+ std::string value = cmJoin(varArgsExpanded, ";");
this->Makefile->AddDefinition(listName, value.c_str());
return true;