summaryrefslogtreecommitdiff
path: root/Source/cmInstallTargetGenerator.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <pa.solodovnikov@tensor.ru>2018-01-25 16:59:33 +0300
committerPavel Solodovnikov <pa.solodovnikov@tensor.ru>2018-01-26 13:24:45 +0300
commitc85bb007df37aad9f20355cdf4d7ca9af562cb20 (patch)
tree97027a278ef535cbb277ae91aa4c2eb620cb6978 /Source/cmInstallTargetGenerator.cxx
parentfa3ac83af0edf958d26b246109db6e3d6d128d70 (diff)
downloadcmake-c85bb007df37aad9f20355cdf4d7ca9af562cb20.tar.gz
Reduce allocation of temporary values on heap.
- Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
Diffstat (limited to 'Source/cmInstallTargetGenerator.cxx')
-rw-r--r--Source/cmInstallTargetGenerator.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 814dc4f002..a9b4908e5b 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -132,8 +132,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
if (this->ImportLibrary) {
std::string from1 = fromDirConfig + targetNameImport;
std::string to1 = toDir + targetNameImport;
- filesFrom.push_back(from1);
- filesTo.push_back(to1);
+ filesFrom.push_back(std::move(from1));
+ filesTo.push_back(std::move(to1));
std::string targetNameImportLib;
if (this->Target->GetImplibGNUtoMS(targetNameImport,
targetNameImportLib)) {
@@ -176,13 +176,13 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
if (targetNameReal != targetName) {
std::string from2 = fromDirConfig + targetNameReal;
std::string to2 = toDir += targetNameReal;
- filesFrom.push_back(from2);
- filesTo.push_back(to2);
+ filesFrom.push_back(std::move(from2));
+ filesTo.push_back(std::move(to2));
}
}
- filesFrom.push_back(from1);
- filesTo.push_back(to1);
+ filesFrom.push_back(std::move(from1));
+ filesTo.push_back(std::move(to1));
}
} else {
std::string targetName;
@@ -198,8 +198,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
std::string from1 = fromDirConfig + targetNameImport;
std::string to1 = toDir + targetNameImport;
- filesFrom.push_back(from1);
- filesTo.push_back(to1);
+ filesFrom.push_back(std::move(from1));
+ filesTo.push_back(std::move(to1));
std::string targetNameImportLib;
if (this->Target->GetImplibGNUtoMS(targetNameImport,
targetNameImportLib)) {
@@ -223,8 +223,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
// Tweaks apply to the binary inside the bundle.
std::string to1 = toDir + targetNameReal;
- filesFrom.push_back(from1);
- filesTo.push_back(to1);
+ filesFrom.push_back(std::move(from1));
+ filesTo.push_back(std::move(to1));
} else if (this->Target->IsCFBundleOnApple()) {
// Install the whole app bundle directory.
type = cmInstallType_DIRECTORY;
@@ -235,8 +235,8 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
std::string from1 = fromDirConfig + targetNameBase;
std::string to1 = toDir + targetName;
- filesFrom.push_back(from1);
- filesTo.push_back(to1);
+ filesFrom.push_back(std::move(from1));
+ filesTo.push_back(std::move(to1));
} else {
bool haveNamelink = false;