diff options
author | Aaron Orenstein <aorenste@fb.com> | 2017-08-11 21:11:18 (GMT) |
---|---|---|
committer | Aaron Orenstein <aorenste@fb.com> | 2017-08-16 22:35:38 (GMT) |
commit | af3fd6f22f317d4209ff679e4f7c8dd8d2d0f89f (patch) | |
tree | f032e00aecd7a92e828b4f8bf0d3229f3bab307a /Source/cmLocalNinjaGenerator.cxx | |
parent | c47c011c77bfd1bfb8d2060511a2b957ce181c62 (diff) | |
download | CMake-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/cmLocalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 266710c..9fa3ca5 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -79,8 +79,8 @@ void cmLocalNinjaGenerator::Generate() } } - std::vector<cmGeneratorTarget*> targets = this->GetGeneratorTargets(); - for (std::vector<cmGeneratorTarget*>::iterator t = targets.begin(); + const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets(); + for (std::vector<cmGeneratorTarget*>::const_iterator t = targets.begin(); t != targets.end(); ++t) { if ((*t)->GetType() == cmStateEnums::INTERFACE_LIBRARY) { continue; |