diff options
author | Aaron Orenstein <aorenste@fb.com> | 2017-08-18 14:59:52 (GMT) |
---|---|---|
committer | Aaron Orenstein <aorenste@fb.com> | 2017-08-18 14:59:52 (GMT) |
commit | 7bc65770171924e550d2937b07b54b83b9fb59ab (patch) | |
tree | 939ec4a9f494913f76d82b0d9e219b95c178f426 /Source/cmLocalVisualStudio7Generator.cxx | |
parent | 10edb0c7d52b1252517990c2e8b898a804f440d3 (diff) | |
download | CMake-7bc65770171924e550d2937b07b54b83b9fb59ab.zip CMake-7bc65770171924e550d2937b07b54b83b9fb59ab.tar.gz CMake-7bc65770171924e550d2937b07b54b83b9fb59ab.tar.bz2 |
Performance: Fix a few more unnecessary vector copies missed in af3fd6f
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index dd08e5b..857ce46 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -62,8 +62,8 @@ cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator() void cmLocalVisualStudio7Generator::AddHelperCommands() { // Now create GUIDs for targets - std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets(); - for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin(); + const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets(); + for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin(); l != tgts.end(); ++l) { if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; @@ -91,8 +91,9 @@ void cmLocalVisualStudio7Generator::AddCMakeListsRules() // specification source changes. if (cmSourceFile* sf = this->CreateVCProjBuildRule()) { // Add the rule to targets that need it. - std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets(); - for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin(); + const std::vector<cmGeneratorTarget*>& tgts = + this->GetGeneratorTargets(); + for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin(); l != tgts.end(); ++l) { if ((*l)->GetType() == cmStateEnums::GLOBAL_TARGET) { continue; @@ -110,8 +111,8 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets() // Visual Studio .NET 2003 Service Pack 1 will not run post-build // commands for targets in which no sources are built. Add dummy // rules to force these targets to build. - std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets(); - for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin(); + const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets(); + for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin(); l != tgts.end(); l++) { if ((*l)->GetType() == cmStateEnums::GLOBAL_TARGET) { std::vector<std::string> no_depends; @@ -150,10 +151,10 @@ void cmLocalVisualStudio7Generator::WriteProjectFiles() } // Get the set of targets in this directory. - std::vector<cmGeneratorTarget*> tgts = this->GetGeneratorTargets(); + const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets(); // Create the project file for each target. - for (std::vector<cmGeneratorTarget*>::iterator l = tgts.begin(); + for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin(); l != tgts.end(); l++) { if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; |