summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-29 13:05:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-29 13:05:27 (GMT)
commit92cd3d06772ada13935790d66927ab4663c7d628 (patch)
tree2550a2ad9003b47f9029c186aeabdfd6521bc615 /Source/cmTarget.cxx
parent18153217e27d2cf560d874313557ec9fa2bcffdb (diff)
parentc85bb007df37aad9f20355cdf4d7ca9af562cb20 (diff)
downloadCMake-92cd3d06772ada13935790d66927ab4663c7d628.zip
CMake-92cd3d06772ada13935790d66927ab4663c7d628.tar.gz
CMake-92cd3d06772ada13935790d66927ab4663c7d628.tar.bz2
Merge topic 'reduce-temporaries'
c85bb007 Reduce allocation of temporary values on heap. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1698
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 663a4c9..33437a1 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -500,7 +500,7 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
}
if (!srcFiles.empty()) {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->SourceEntries.push_back(srcFiles);
+ this->Internal->SourceEntries.push_back(std::move(srcFiles));
this->Internal->SourceBacktraces.push_back(lfbt);
}
}
@@ -747,10 +747,12 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, const std::string& lib,
return;
}
- cmTarget::LibraryID tmp;
- tmp.first = lib;
- tmp.second = llt;
- this->OriginalLinkLibraries.push_back(tmp);
+ {
+ cmTarget::LibraryID tmp;
+ tmp.first = lib;
+ tmp.second = llt;
+ this->OriginalLinkLibraries.emplace_back(lib, llt);
+ }
// Add the explicit dependency information for this target. This is
// simply a set of libraries separated by ";". There should always