diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-11-22 10:00:45 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-01-11 16:00:55 (GMT) |
commit | 238dd2fbab1bd4fb53a25dcd07c1ee41da46d451 (patch) | |
tree | 2ad1d3c2057e6d568fb55da0a9b872f992cb06d6 /Source/cmLocalGenerator.cxx | |
parent | 2f7ef7e38d7aad93f5d25efb4fd7f61468cf06a2 (diff) | |
download | CMake-238dd2fbab1bd4fb53a25dcd07c1ee41da46d451.zip CMake-238dd2fbab1bd4fb53a25dcd07c1ee41da46d451.tar.gz CMake-238dd2fbab1bd4fb53a25dcd07c1ee41da46d451.tar.bz2 |
Use insert instead of a loop in some cases.
Limit this change to inserting into a vector from a vector.
A follow up change can use insert for inserting into a set.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2de6c93..a4185ad 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -634,11 +634,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname, // Parse the string to get the custom command line. cmCustomCommandLine commandLine; std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str()); - for(std::vector<std::string>::iterator a = cmd.begin(); - a != cmd.end(); ++a) - { - commandLine.push_back(*a); - } + commandLine.insert(commandLine.end(), cmd.begin(), cmd.end()); // Store this command line. commandLines.push_back(commandLine); @@ -745,11 +741,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang, // Parse the string to get the custom command line. cmCustomCommandLine commandLine; std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str()); - for(std::vector<std::string>::iterator a = cmd.begin(); - a != cmd.end(); ++a) - { - commandLine.push_back(*a); - } + commandLine.insert(commandLine.end(), cmd.begin(), cmd.end()); // Store this command line. commandLines.push_back(commandLine); |