summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-01-21 18:55:53 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-01-21 18:55:53 (GMT)
commit3e7794a2e6297e8ed3e114e92ea1480f75aa38b1 (patch)
tree852d26049320fbf8b18dc8da26722274625c5328 /Source/cmGlobalGenerator.cxx
parentaaf06f2b0f4ce4085e2bf1c60ffc63065968a9c6 (diff)
parent70788e92641c4cf4c3f20af607cc6e203203b420 (diff)
downloadCMake-3e7794a2e6297e8ed3e114e92ea1480f75aa38b1.zip
CMake-3e7794a2e6297e8ed3e114e92ea1480f75aa38b1.tar.gz
CMake-3e7794a2e6297e8ed3e114e92ea1480f75aa38b1.tar.bz2
Merge topic 'reduce-allocations'
70788e92 Remove temporary allocations when calling cmHasLiteral{Suf,Pre}fix. bd2384f5 Optimize cmMakefile::ExpandVariablesInStringNew. ad9394f4 Remove temporary allocations in cmMacroHelper::InvokeInitialPass. f9599ed4 Remove temporary allocations by extending the lifetime of the retval. 275f2a85 Remove temporary allocations when calling cmGeneratorTarget::GetName.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index c50bf66..d7bec44 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2198,9 +2198,9 @@ cmGlobalGenerator::FindGeneratorTargetImpl(std::string const& name) const
{
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
{
- std::vector<cmGeneratorTarget*> tgts =
+ const std::vector<cmGeneratorTarget*>& tgts =
this->LocalGenerators[i]->GetGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator it = tgts.begin();
it != tgts.end(); ++it)
{
if ((*it)->GetName() == name)
@@ -2217,9 +2217,9 @@ cmGlobalGenerator::FindImportedTargetImpl(std::string const& name) const
{
for (unsigned int i = 0; i < this->Makefiles.size(); ++i)
{
- std::vector<cmTarget*> tgts =
+ const std::vector<cmTarget*>& tgts =
this->Makefiles[i]->GetOwnedImportedTargets();
- for (std::vector<cmTarget*>::iterator it = tgts.begin();
+ for (std::vector<cmTarget*>::const_iterator it = tgts.begin();
it != tgts.end(); ++it)
{
if ((*it)->GetName() == name && (*it)->IsImportedGloballyVisible())
@@ -2236,9 +2236,9 @@ cmGeneratorTarget* cmGlobalGenerator::FindImportedGeneratorTargetImpl(
{
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
{
- std::vector<cmGeneratorTarget*> tgts =
+ const std::vector<cmGeneratorTarget*>& tgts =
this->LocalGenerators[i]->GetImportedGeneratorTargets();
- for (std::vector<cmGeneratorTarget*>::iterator it = tgts.begin();
+ for (std::vector<cmGeneratorTarget*>::const_iterator it = tgts.begin();
it != tgts.end(); ++it)
{
if ((*it)->IsImportedGloballyVisible() && (*it)->GetName() == name)