summaryrefslogtreecommitdiffstats
path: root/Source/CPack
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/CPack
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/CPack')
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx2
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx2
-rw-r--r--Source/CPack/cpack.cxx2
6 files changed, 12 insertions, 12 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index bcbe84d..05a852d 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -467,7 +467,7 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
std::string name = cmSystemTools::GetFilenameName(this->Resources[i]);
std::string path = this->Directory + "/resources/" + name;
cmsys::SystemTools::CopyFileIfDifferent(this->Resources[i], path);
- resources.push_back(name);
+ resources.push_back(std::move(name));
} else {
cmCPackIFWLogger(WARNING, "Can't copy resources from \""
<< this->Resources[i]
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 641be38..893b2fc 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -132,7 +132,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
}
}
// add the generated package to package file names list
- packageFileNames.push_back(packageFileName);
+ packageFileNames.push_back(std::move(packageFileName));
}
// Handle Orphan components (components not belonging to any groups)
for (auto& comp : this->Components) {
@@ -157,7 +157,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
addOneComponentToArchive(archive, &(comp.second));
}
// add the generated package to package file names list
- packageFileNames.push_back(packageFileName);
+ packageFileNames.push_back(std::move(packageFileName));
}
}
}
@@ -178,7 +178,7 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
addOneComponentToArchive(archive, &(comp.second));
}
// add the generated package to package file names list
- packageFileNames.push_back(packageFileName);
+ packageFileNames.push_back(std::move(packageFileName));
}
}
return 1;
@@ -188,7 +188,7 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne()
{
// reset the package file names
packageFileNames.clear();
- packageFileNames.push_back(std::string(toplevel));
+ packageFileNames.emplace_back(toplevel);
packageFileNames[0] += "/";
if (this->IsSet("CPACK_ARCHIVE_FILE_NAME")) {
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 7fc3c26..8ec54f8 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -89,7 +89,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
packageFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
packageFileName += "/";
packageFileName += this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME");
- packageFileNames.push_back(packageFileName);
+ packageFileNames.push_back(std::move(packageFileName));
return retval;
}
@@ -206,7 +206,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
packageFileName = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
packageFileName += "/";
packageFileName += this->GetOption("GEN_CPACK_OUTPUT_FILE_NAME");
- packageFileNames.push_back(packageFileName);
+ packageFileNames.push_back(std::move(packageFileName));
return retval;
}
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index fabcf60..54a2a27 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -314,7 +314,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 =
@@ -384,8 +384,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(),
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 965283d..ef2add3 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -116,7 +116,7 @@ int cmCPackNSISGenerator::PackageFiles()
dstr << " RMDir \"" << componentOutputDir << "\\" << fileN << "\""
<< std::endl;
if (!componentName.empty()) {
- this->Components[componentName].Directories.push_back(fileN);
+ this->Components[componentName].Directories.push_back(std::move(fileN));
}
}
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: " << dstr.str()
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 2b2152c..7d47798 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -432,7 +432,7 @@ int main(int argc, char const* const* argv)
cmDocumentationEntry e;
e.Name = g.first;
e.Brief = g.second;
- v.push_back(e);
+ v.push_back(std::move(e));
}
doc.SetSection("Generators", v);