diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-01-07 07:58:51 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-01-08 21:28:18 (GMT) |
commit | 55a73e6b1f70b3c8a783b130dff4c4689cea5ba2 (patch) | |
tree | ac22109c28ecd6b59d6f538efdc8ece375388928 /Source/cmListCommand.cxx | |
parent | 8dc8d756bc278cd02f329b31218c2459908dc0bb (diff) | |
download | CMake-55a73e6b1f70b3c8a783b130dff4c4689cea5ba2.zip CMake-55a73e6b1f70b3c8a783b130dff4c4689cea5ba2.tar.gz CMake-55a73e6b1f70b3c8a783b130dff4c4689cea5ba2.tar.bz2 |
Use the cmJoin algorithm where possible.
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r-- | Source/cmListCommand.cxx | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index f1ea088..b58f240 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -353,15 +353,7 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args) cnt ++; } - std::string value; - const char* sep = ""; - for ( cc = 0; cc < varArgsExpanded.size(); cc ++ ) - { - value += sep; - value += varArgsExpanded[cc]; - sep = ";"; - } - + std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); return true; } @@ -402,15 +394,8 @@ bool cmListCommand } } - std::string value; - const char* sep = ""; - for ( cc = 0; cc < varArgsExpanded.size(); cc ++ ) - { - value += sep; - value += varArgsExpanded[cc]; - sep = ";"; - } + std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); return true; } @@ -518,16 +503,7 @@ bool cmListCommand std::sort(varArgsExpanded.begin(), varArgsExpanded.end()); - std::string value; - std::vector<std::string>::iterator it; - const char* sep = ""; - for ( it = varArgsExpanded.begin(); it != varArgsExpanded.end(); ++ it ) - { - value += sep; - value += it->c_str(); - sep = ";"; - } - + std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); return true; } |