mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
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.
This commit is contained in:
@@ -161,7 +161,7 @@ void cmComputeTargetDepends::CollectTargets()
|
||||
std::vector<cmLocalGenerator*> const& lgens =
|
||||
this->GlobalGenerator->GetLocalGenerators();
|
||||
for (unsigned int i = 0; i < lgens.size(); ++i) {
|
||||
const std::vector<cmGeneratorTarget*> targets =
|
||||
const std::vector<cmGeneratorTarget*>& targets =
|
||||
lgens[i]->GetGeneratorTargets();
|
||||
for (std::vector<cmGeneratorTarget*>::const_iterator ti = targets.begin();
|
||||
ti != targets.end(); ++ti) {
|
||||
|
||||
Reference in New Issue
Block a user