summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackGenerator.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <pa.solodovnikov@tensor.ru>2018-01-25 13:59:33 (GMT)
committerPavel Solodovnikov <pa.solodovnikov@tensor.ru>2018-01-26 10:24:45 (GMT)
commitc85bb007df37aad9f20355cdf4d7ca9af562cb20 (patch)
tree97027a278ef535cbb277ae91aa4c2eb620cb6978 /Source/CPack/cmCPackGenerator.cxx
parentfa3ac83af0edf958d26b246109db6e3d6d128d70 (diff)
downloadCMake-c85bb007df37aad9f20355cdf4d7ca9af562cb20.zip
CMake-c85bb007df37aad9f20355cdf4d7ca9af562cb20.tar.gz
CMake-c85bb007df37aad9f20355cdf4d7ca9af562cb20.tar.bz2
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/CPack/cmCPackGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 69e53e1..03fa018 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -313,7 +313,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
for (std::string const& ifr : ignoreFilesRegexString) {
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Create ignore files regex for: " << ifr << std::endl);
- ignoreFilesRegex.push_back(ifr.c_str());
+ ignoreFilesRegex.emplace_back(ifr);
}
}
const char* installDirectories =
@@ -383,8 +383,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
std::string inFileRelative =
cmSystemTools::RelativePath(top.c_str(), inFile.c_str());
cmSystemTools::ReadSymlink(inFile, targetFile);
- symlinkedFiles.push_back(
- std::pair<std::string, std::string>(targetFile, inFileRelative));
+ symlinkedFiles.emplace_back(std::move(targetFile),
+ std::move(inFileRelative));
}
/* If it is not a symlink then do a plain copy */
else if (!(cmSystemTools::CopyFileIfDifferent(inFile.c_str(),