summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraCodeLiteGenerator.cxx
diff options
context:
space:
mode:
authorAaron Orenstein <aorenste@fb.com>2017-08-11 21:11:18 (GMT)
committerAaron Orenstein <aorenste@fb.com>2017-08-16 22:35:38 (GMT)
commitaf3fd6f22f317d4209ff679e4f7c8dd8d2d0f89f (patch)
treef032e00aecd7a92e828b4f8bf0d3229f3bab307a /Source/cmExtraCodeLiteGenerator.cxx
parentc47c011c77bfd1bfb8d2060511a2b957ce181c62 (diff)
downloadCMake-af3fd6f22f317d4209ff679e4f7c8dd8d2d0f89f.zip
CMake-af3fd6f22f317d4209ff679e4f7c8dd8d2d0f89f.tar.gz
CMake-af3fd6f22f317d4209ff679e4f7c8dd8d2d0f89f.tar.bz2
Performance: Add an index to Change cmLocalGenerator::GeneratorTargets.
Add an index to Change cmLocalGenerator::GeneratorTargets for faster lookup by name. Also changed a bunch of uses of cmLocalGenerator::GetGeneratorTargets() to take const references instead of copying the vector. Represent generator targets as a map (name -> target) to make name lookups more efficient instead of looping through the entire vector to find the desired one.
Diffstat (limited to 'Source/cmExtraCodeLiteGenerator.cxx')
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index b478f34..96502d5 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -292,8 +292,9 @@ void cmExtraCodeLiteGenerator::CreateNewProjectFile(
for (std::vector<cmLocalGenerator*>::const_iterator lg = lgs.begin();
lg != lgs.end(); lg++) {
cmMakefile* makefile = (*lg)->GetMakefile();
- std::vector<cmGeneratorTarget*> targets = (*lg)->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin();
+ const std::vector<cmGeneratorTarget*>& targets =
+ (*lg)->GetGeneratorTargets();
+ for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
ti != targets.end(); ti++) {
projectType = CollectSourceFiles(makefile, *ti, cFiles, otherFiles);
}