summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-11-22 10:00:45 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-01-11 16:00:55 (GMT)
commit238dd2fbab1bd4fb53a25dcd07c1ee41da46d451 (patch)
tree2ad1d3c2057e6d568fb55da0a9b872f992cb06d6 /Source/cmQtAutoGenerators.cxx
parent2f7ef7e38d7aad93f5d25efb4fd7f61468cf06a2 (diff)
downloadCMake-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/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx31
1 files changed, 7 insertions, 24 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index a01a384..443162a 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -2188,24 +2188,12 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
std::vector<std::string> command;
command.push_back(this->MocExecutable);
- for (std::list<std::string>::const_iterator it = this->MocIncludes.begin();
- it != this->MocIncludes.end();
- ++it)
- {
- command.push_back(*it);
- }
- for(std::list<std::string>::const_iterator it=this->MocDefinitions.begin();
- it != this->MocDefinitions.end();
- ++it)
- {
- command.push_back(*it);
- }
- for(std::vector<std::string>::const_iterator it=this->MocOptions.begin();
- it != this->MocOptions.end();
- ++it)
- {
- command.push_back(*it);
- }
+ command.insert(command.end(),
+ this->MocIncludes.begin(), this->MocIncludes.end());
+ command.insert(command.end(),
+ this->MocDefinitions.begin(), this->MocDefinitions.end());
+ command.insert(command.end(),
+ this->MocOptions.begin(), this->MocOptions.end());
#ifdef _WIN32
command.push_back("-DWIN32");
#endif
@@ -2277,12 +2265,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
cmSystemTools::ExpandListArgument(optionIt->second, fileOpts);
this->MergeUicOptions(opts, fileOpts, this->QtMajorVersion == "5");
}
- for(std::vector<std::string>::const_iterator optIt = opts.begin();
- optIt != opts.end();
- ++optIt)
- {
- command.push_back(*optIt);
- }
+ command.insert(command.end(), opts.begin(), opts.end());
command.push_back("-o");
command.push_back(this->Builddir + ui_output_file);