summaryrefslogtreecommitdiffstats
path: root/Source/cmListCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-12 14:41:02 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-01-12 14:41:02 (GMT)
commitdd6c596c12070c0fdc71cb11ac154e99111fb6e0 (patch)
tree27fc1aa3fb5d409e619f590ede5fee3bf477f925 /Source/cmListCommand.cxx
parentd9a6ea4599eb3b736b4e695a9ffd5d8a51eac059 (diff)
parent55a73e6b1f70b3c8a783b130dff4c4689cea5ba2 (diff)
downloadCMake-dd6c596c12070c0fdc71cb11ac154e99111fb6e0.zip
CMake-dd6c596c12070c0fdc71cb11ac154e99111fb6e0.tar.gz
CMake-dd6c596c12070c0fdc71cb11ac154e99111fb6e0.tar.bz2
Merge topic 'join-algorithm'
55a73e6b Use the cmJoin algorithm where possible. 8dc8d756 cmStandardIncludes: Add a join algorithm for string containers. b5813cee cmInstallCommand: Remove unused variable.
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r--Source/cmListCommand.cxx30
1 files changed, 3 insertions, 27 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 47b8be5..c3f0f57 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;
}