diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-21 19:06:00 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-21 19:43:48 (GMT) |
commit | 204c5ccb43e8a0bc937d8adac5eaa4b73f12140d (patch) | |
tree | 7d1fb053a5e9c05e9471df24672878e3a2c54a7e /Source/cmGlobalGenerator.cxx | |
parent | e09c606eb47c13bd435892625943e95bb9452996 (diff) | |
download | CMake-204c5ccb43e8a0bc937d8adac5eaa4b73f12140d.zip CMake-204c5ccb43e8a0bc937d8adac5eaa4b73f12140d.tar.gz CMake-204c5ccb43e8a0bc937d8adac5eaa4b73f12140d.tar.bz2 |
cmMakefile: Use std::unordered_map::emplace to add cmTargets to the list
When adding cmTargets to a cmMakefile, use std::unordered_map::emplace instead
of std::unordered_map::insert.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 6964b62..00781c3 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1214,14 +1214,16 @@ void cmGlobalGenerator::Configure() this->ConfigureDoneCMP0026AndCMP0024 = true; // Put a copy of each global target in every directory. - std::vector<GlobalTargetInfo> globalTargets; - this->CreateDefaultGlobalTargets(globalTargets); - - for (cmMakefile* mf : this->Makefiles) { - cmTargets* targets = &(mf->GetTargets()); - for (GlobalTargetInfo const& globalTarget : globalTargets) { - targets->insert(cmTargets::value_type( - globalTarget.Name, this->CreateGlobalTarget(globalTarget, mf))); + { + std::vector<GlobalTargetInfo> globalTargets; + this->CreateDefaultGlobalTargets(globalTargets); + + for (cmMakefile* mf : this->Makefiles) { + auto& targets = mf->GetTargets(); + for (GlobalTargetInfo const& globalTarget : globalTargets) { + targets.emplace(globalTarget.Name, + this->CreateGlobalTarget(globalTarget, mf)); + } } } |