diff options
author | Brad King <brad.king@kitware.com> | 2018-01-29 13:05:17 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-29 13:05:27 (GMT) |
commit | 92cd3d06772ada13935790d66927ab4663c7d628 (patch) | |
tree | 2550a2ad9003b47f9029c186aeabdfd6521bc615 /Source/cmake.cxx | |
parent | 18153217e27d2cf560d874313557ec9fa2bcffdb (diff) | |
parent | c85bb007df37aad9f20355cdf4d7ca9af562cb20 (diff) | |
download | CMake-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/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f488552..39beb9f 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -913,7 +913,7 @@ void cmake::GetRegisteredGenerators( info.name = name; info.baseName = name; info.isAlias = false; - generators.push_back(info); + generators.push_back(std::move(info)); } } @@ -929,7 +929,7 @@ void cmake::GetRegisteredGenerators( info.supportsPlatform = false; info.supportsToolset = false; info.isAlias = false; - generators.push_back(info); + generators.push_back(std::move(info)); } for (std::string const& a : eg->Aliases) { GeneratorInfo info; @@ -941,7 +941,7 @@ void cmake::GetRegisteredGenerators( info.supportsPlatform = false; info.supportsToolset = false; info.isAlias = true; - generators.push_back(info); + generators.push_back(std::move(info)); } } } @@ -1168,7 +1168,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) save.help = help; } } - saved.push_back(save); + saved.push_back(std::move(save)); } // remove the cache @@ -1808,7 +1808,7 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v) for (cmGlobalGeneratorFactory* g : this->Generators) { cmDocumentationEntry e; g->GetDocumentation(e); - v.push_back(e); + v.push_back(std::move(e)); } for (cmExternalMakefileProjectGeneratorFactory* eg : this->ExtraGenerators) { const std::string doc = eg->GetDocumentation(); @@ -1819,7 +1819,7 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v) cmDocumentationEntry e; e.Name = a; e.Brief = doc; - v.push_back(e); + v.push_back(std::move(e)); } // Full names: @@ -1830,7 +1830,7 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v) e.Name = cmExternalMakefileProjectGenerator::CreateFullGeneratorName(g, name); e.Brief = doc; - v.push_back(e); + v.push_back(std::move(e)); } } } @@ -2213,9 +2213,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args) std::vector<std::string> args2; args2.push_back(args[0]); args2.push_back(destPath); - std::string resultArg = "-DRESULT_FILE="; - resultArg += resultFile; - args2.push_back(resultArg); + args2.push_back("-DRESULT_FILE=" + resultFile); int res = this->Run(args2, false); if (res != 0) { |