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/cmExtraKateGenerator.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/cmExtraKateGenerator.cxx')
-rw-r--r-- | Source/cmExtraKateGenerator.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index 3730433..e366774 100644 --- a/Source/cmExtraKateGenerator.cxx +++ b/Source/cmExtraKateGenerator.cxx @@ -115,7 +115,7 @@ void cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg, for (std::vector<cmLocalGenerator*>::const_iterator it = this->GlobalGenerator->GetLocalGenerators().begin(); it != this->GlobalGenerator->GetLocalGenerators().end(); ++it) { - const std::vector<cmGeneratorTarget*> targets = + const std::vector<cmGeneratorTarget*>& targets = (*it)->GetGeneratorTargets(); std::string currentDir = (*it)->GetCurrentBinaryDirectory(); bool topLevel = (currentDir == (*it)->GetBinaryDirectory()); |