diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-11-25 15:33:00 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-01-11 16:00:55 (GMT) |
commit | 6162c9194bfb416ac43f52f281db442a4d484aff (patch) | |
tree | 09a0aed1555a18c1c44af2c8e81a725dca8f051f /Source | |
parent | 238dd2fbab1bd4fb53a25dcd07c1ee41da46d451 (diff) | |
download | CMake-6162c9194bfb416ac43f52f281db442a4d484aff.zip CMake-6162c9194bfb416ac43f52f281db442a4d484aff.tar.gz CMake-6162c9194bfb416ac43f52f281db442a4d484aff.tar.bz2 |
Use two-iterator std::set::insert where appropriate.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 6 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 15 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 18 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 6 | ||||
-rw-r--r-- | Source/cmCommandArgumentsHelper.cxx | 9 | ||||
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 19 | ||||
-rw-r--r-- | Source/cmDependsC.cxx | 6 | ||||
-rw-r--r-- | Source/cmDependsFortran.cxx | 10 | ||||
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 22 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 6 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 9 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 12 | ||||
-rw-r--r-- | Source/cmIncludeDirectoryCommand.cxx | 6 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 18 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 14 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 20 |
18 files changed, 41 insertions, 168 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 7e00027..59c38e9 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -1150,12 +1150,7 @@ void cmCPackWIXGenerator::CollectExtensions( std::vector<std::string> list; cmSystemTools::ExpandListArgument(variableContent, list); - - for(std::vector<std::string>::const_iterator i = list.begin(); - i != list.end(); ++i) - { - extensions.insert(*i); - } + extensions.insert(list.begin(), list.end()); } void cmCPackWIXGenerator::AddCustomFlags( diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index a1d770b..fb3e367 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -2498,11 +2498,7 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir) // Label the source with the target labels. LabelSet& labelSet = this->SourceLabels[source]; - for(std::vector<int>::const_iterator li = targetLabels.begin(); - li != targetLabels.end(); ++li) - { - labelSet.insert(*li); - } + labelSet.insert(targetLabels.begin(), targetLabels.end()); } } } diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 97637ed..b83ebe0 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -162,12 +162,9 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test) //--------------------------------------------------------- void cmCTestMultiProcessHandler::LockResources(int index) { - for(std::set<std::string>::iterator i = - this->Properties[index]->LockedResources.begin(); - i != this->Properties[index]->LockedResources.end(); ++i) - { - this->LockedResources.insert(*i); - } + this->LockedResources.insert( + this->Properties[index]->LockedResources.begin(), + this->Properties[index]->LockedResources.end()); } //--------------------------------------------------------- @@ -499,11 +496,7 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList() i != previousSet.end(); ++i) { TestSet const& dependencies = this->Tests[*i]; - for(TestSet::const_iterator j = dependencies.begin(); - j != dependencies.end(); ++j) - { - currentSet.insert(*j); - } + currentSet.insert(dependencies.begin(), dependencies.end()); } for(TestSet::const_iterator i = currentSet.begin(); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 6aa1c2b..fea94ba 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1160,11 +1160,7 @@ int cmCTestSubmitHandler::ProcessHandler() { // Submit the explicitly selected files: // - cmCTest::SetOfStrings::const_iterator it; - for (it = this->Files.begin(); it != this->Files.end(); ++it) - { - files.insert(*it); - } + files.insert(this->Files.begin(), this->Files.end()); } // Add to the list of files to submit from any selected, existing parts: @@ -1219,11 +1215,7 @@ int cmCTestSubmitHandler::ProcessHandler() // Submit files from this part. std::vector<std::string> const& pfiles = this->CTest->GetSubmitFiles(p); - for(std::vector<std::string>::const_iterator pi = pfiles.begin(); - pi != pfiles.end(); ++pi) - { - files.insert(*pi); - } + files.insert(pfiles.begin(), pfiles.end()); } if ( ofs ) @@ -1503,9 +1495,5 @@ void cmCTestSubmitHandler::SelectParts(std::set<cmCTest::Part> const& parts) //---------------------------------------------------------------------------- void cmCTestSubmitHandler::SelectFiles(cmCTest::SetOfStrings const& files) { - cmCTest::SetOfStrings::const_iterator it; - for (it = files.begin(); it != files.end(); ++it) - { - this->Files.insert(*it); - } + this->Files.insert(files.begin(), files.end()); } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 38ce3dc..0d8d46e 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2163,11 +2163,7 @@ bool cmCTestTestHandler::SetTestsProperties( std::vector<std::string> lval; cmSystemTools::ExpandListArgument(val, lval); - for(std::vector<std::string>::iterator f = lval.begin(); - f != lval.end(); ++f) - { - rtit->LockedResources.insert(*f); - } + rtit->LockedResources.insert(lval.begin(), lval.end()); } if ( key == "TIMEOUT" ) { diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx index 1d5fc07..1a2efc6 100644 --- a/Source/cmCommandArgumentsHelper.cxx +++ b/Source/cmCommandArgumentsHelper.cxx @@ -50,13 +50,8 @@ void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group) if (group!=0) { this->ArgumentsBeforeEmpty = false; - for(std::vector<cmCommandArgument*>::const_iterator - argIt= group->ContainedArguments.begin(); - argIt != group->ContainedArguments.end(); - ++argIt) - { - this->ArgumentsBefore.insert(*argIt); - } + this->ArgumentsBefore.insert(group->ContainedArguments.begin(), + group->ContainedArguments.end()); } } diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index f4fa5c6..7171d6b 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -408,11 +408,7 @@ cmComputeLinkInformation // Construct a mask to not bother with this behavior for link // directories already specified by the user. std::vector<std::string> const& dirs = this->Target->GetLinkDirectories(); - for(std::vector<std::string>::const_iterator di = dirs.begin(); - di != dirs.end(); ++di) - { - this->OldLinkDirMask.insert(*di); - } + this->OldLinkDirMask.insert(dirs.begin(), dirs.end()); } } @@ -1420,11 +1416,8 @@ void cmComputeLinkInformation::ComputeFrameworkInfo() cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec); } - for(std::vector<std::string>::const_iterator i = implicitDirVec.begin(); - i != implicitDirVec.end(); ++i) - { - this->FrameworkPathsEmmitted.insert(*i); - } + this->FrameworkPathsEmmitted.insert(implicitDirVec.begin(), + implicitDirVec.end()); // Regular expression to extract a framework path and name. this->SplitFramework.compile("(.*)/(.*)\\.framework$"); @@ -1694,11 +1687,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo() } // Store implicit link directories. - for(std::vector<std::string>::const_iterator i = implicitDirVec.begin(); - i != implicitDirVec.end(); ++i) - { - this->ImplicitLinkDirs.insert(*i); - } + this->ImplicitLinkDirs.insert(implicitDirVec.begin(), implicitDirVec.end()); // Get language-specific implicit libraries. std::vector<std::string> implicitLibVec; diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index a1fc268..a8711eb 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -125,11 +125,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, this->ValidDeps->find(obj); if (tmpIt!= this->ValidDeps->end()) { - for(DependencyVector::const_iterator i=tmpIt->second.begin(); - i != tmpIt->second.end(); ++i) - { - dependencies.insert(*i); - } + dependencies.insert(tmpIt->second.begin(), tmpIt->second.end()); haveDeps = true; } } diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 4082d24..d9818ce 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -319,17 +319,13 @@ void cmDependsFortran::LocateModules() infoI != objInfo.end(); ++infoI) { cmDependsFortranSourceInfo const& info = infoI->second; - for(std::set<std::string>::const_iterator i = info.Provides.begin(); - i != info.Provides.end(); ++i) - { - // Include this module in the set provided by this target. - this->Internal->TargetProvides.insert(*i); - } + // Include this module in the set provided by this target. + this->Internal->TargetProvides.insert(info.Provides.begin(), + info.Provides.end()); for(std::set<std::string>::const_iterator i = info.Requires.begin(); i != info.Requires.end(); ++i) { - // Include this module in the set required by this target. this->Internal->TargetRequires[*i] = ""; } } diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 1f39d7a..2b81d60 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -456,11 +456,7 @@ void getPropertyContents(cmTarget const* tgt, const std::string& prop, } std::vector<std::string> content; cmSystemTools::ExpandListArgument(p, content); - for (std::vector<std::string>::const_iterator ci = content.begin(); - ci != content.end(); ++ci) - { - ifaceProperties.insert(*ci); - } + ifaceProperties.insert(content.begin(), content.end()); } //---------------------------------------------------------------------------- diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 79d7bcaff..69857ef 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -615,12 +615,8 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, std::vector<std::string> includes; target->GetMakefile()->GetLocalGenerator()-> GetIncludeDirectories(includes, gtgt, "C", buildType); - for(std::vector<std::string>::const_iterator dirIt=includes.begin(); - dirIt != includes.end(); - ++dirIt) - { - uniqIncludeDirs.insert(*dirIt); - } + + uniqIncludeDirs.insert(includes.begin(), includes.end()); std::string systemIncludeDirs = makefile->GetSafeDefinition( "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS"); @@ -628,12 +624,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, { std::vector<std::string> dirs; cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs); - for(std::vector<std::string>::const_iterator dirIt=dirs.begin(); - dirIt != dirs.end(); - ++dirIt) - { - uniqIncludeDirs.insert(*dirIt); - } + uniqIncludeDirs.insert(dirs.begin(), dirs.end()); } systemIncludeDirs = makefile->GetSafeDefinition( @@ -642,12 +633,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, { std::vector<std::string> dirs; cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs); - for(std::vector<std::string>::const_iterator dirIt=dirs.begin(); - dirIt != dirs.end(); - ++dirIt) - { - uniqIncludeDirs.insert(*dirIt); - } + uniqIncludeDirs.insert(dirs.begin(), dirs.end()); } for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin(); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 435452c..56213e9 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -818,11 +818,7 @@ cmTargetTraceDependencies = ge.Parse(*cli); cge->Evaluate(this->Makefile, "", true); std::set<cmTarget*> geTargets = cge->GetTargets(); - for(std::set<cmTarget*>::const_iterator it = geTargets.begin(); - it != geTargets.end(); ++it) - { - targets.insert(*it); - } + targets.insert(geTargets.begin(), geTargets.end()); } } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 6f0586b..07ea942 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1021,12 +1021,9 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) } //insert outputs from all WirteBuild commands - for(std::set<std::string>::iterator i = this->CombinedBuildOutputs.begin(); - i != this->CombinedBuildOutputs.end(); ++i) - { - //these paths have already be encoded when added to CombinedBuildOutputs - knownDependencies.insert(*i); - } + //these paths have already be encoded when added to CombinedBuildOutputs + knownDependencies.insert(this->CombinedBuildOutputs.begin(), + this->CombinedBuildOutputs.end()); //after we have combined the data into knownDependencies we have no need //to keep this data around diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 2dab23c..320a1f4 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -845,22 +845,14 @@ cmGlobalVisualStudioGenerator::TargetCompare cmGlobalVisualStudioGenerator::OrderedTargetDependSet ::OrderedTargetDependSet(TargetDependSet const& targets) { - for(TargetDependSet::const_iterator ti = - targets.begin(); ti != targets.end(); ++ti) - { - this->insert(*ti); - } + this->insert(targets.begin(), targets.end()); } //---------------------------------------------------------------------------- cmGlobalVisualStudioGenerator::OrderedTargetDependSet ::OrderedTargetDependSet(TargetSet const& targets) { - for(TargetSet::const_iterator ti = targets.begin(); - ti != targets.end(); ++ti) - { - this->insert(*ti); - } + this->insert(targets.begin(), targets.end()); } std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir( diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index df5508e..f37d8bc 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -71,11 +71,7 @@ bool cmIncludeDirectoryCommand } if (system) { - for (std::vector<std::string>::const_iterator li = includes.begin(); - li != includes.end(); ++li) - { - systemIncludes.insert(*li); - } + systemIncludes.insert(includes.begin(), includes.end()); } } std::reverse(beforeIncludes.begin(), beforeIncludes.end()); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 25d5881..25d23f7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1822,11 +1822,7 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs, void cmMakefile::AddSystemIncludeDirectories(const std::set<std::string> &incs) { - for(std::set<std::string>::const_iterator li = incs.begin(); - li != incs.end(); ++li) - { - this->SystemIncludeDirectories.insert(*li); - } + this->SystemIncludeDirectories.insert(incs.begin(), incs.end()); for (cmTargets::iterator l = this->Targets.begin(); l != this->Targets.end(); ++l) @@ -4556,16 +4552,8 @@ void cmMakefile::PopScope() this->Internal->VarInitStack.pop(); this->Internal->VarUsageStack.pop(); // Push initialization and usage up to the parent scope. - it = init.begin(); - for (; it != init.end(); ++it) - { - this->Internal->VarInitStack.top().insert(*it); - } - it = usage.begin(); - for (; it != usage.end(); ++it) - { - this->Internal->VarUsageStack.top().insert(*it); - } + this->Internal->VarInitStack.top().insert(init.begin(), init.end()); + this->Internal->VarUsageStack.top().insert(usage.begin(), usage.end()); } void cmMakefile::RaiseScope(const std::string& var, const char *varDef) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 443162a..ded85c3 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -899,12 +899,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target, std::set<std::string> skipped; std::vector<std::string> skipVec; cmSystemTools::ExpandListArgument(this->SkipUic, skipVec); - - for (std::vector<std::string>::const_iterator li = skipVec.begin(); - li != skipVec.end(); ++li) - { - skipped.insert(*li); - } + skipped.insert(skipVec.begin(), skipVec.end()); makefile->AddDefinition("_skip_uic", cmLocalGenerator::EscapeForCMake(this->SkipUic).c_str()); @@ -1622,12 +1617,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) std::vector<std::string> headerFilesVec; cmSystemTools::ExpandListArgument(this->Headers, headerFilesVec); - for (std::vector<std::string>::const_iterator it = headerFilesVec.begin(); - it != headerFilesVec.end(); - ++it) - { - headerFiles.insert(*it); - } + headerFiles.insert(headerFilesVec.begin(), headerFilesVec.end()); // key = moc source filepath, value = moc output filename std::map<std::string, std::string> notIncludedMocs; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 1b39804..c8fbf61 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -424,12 +424,8 @@ void cmTarget::SetMakefile(cmMakefile* mf) const std::set<std::string> parentSystemIncludes = this->Makefile->GetSystemIncludeDirectories(); - for (std::set<std::string>::const_iterator it - = parentSystemIncludes.begin(); - it != parentSystemIncludes.end(); ++it) - { - this->SystemIncludeDirectories.insert(*it); - } + this->SystemIncludeDirectories.insert(parentSystemIncludes.begin(), + parentSystemIncludes.end()); const std::vector<cmValueWithOrigin> parentOptions = this->Makefile->GetCompileOptionsEntries(); @@ -1397,22 +1393,14 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, void cmTarget::AddSystemIncludeDirectories(const std::set<std::string> &incs) { - for(std::set<std::string>::const_iterator li = incs.begin(); - li != incs.end(); ++li) - { - this->SystemIncludeDirectories.insert(*li); - } + this->SystemIncludeDirectories.insert(incs.begin(), incs.end()); } //---------------------------------------------------------------------------- void cmTarget::AddSystemIncludeDirectories(const std::vector<std::string> &incs) { - for(std::vector<std::string>::const_iterator li = incs.begin(); - li != incs.end(); ++li) - { - this->SystemIncludeDirectories.insert(*li); - } + this->SystemIncludeDirectories.insert(incs.begin(), incs.end()); } #if defined(_WIN32) && !defined(__CYGWIN__) |