diff options
author | Pavel Solodovnikov <pa.solodovnikov@tensor.ru> | 2018-01-25 13:59:33 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <pa.solodovnikov@tensor.ru> | 2018-01-26 10:24:45 (GMT) |
commit | c85bb007df37aad9f20355cdf4d7ca9af562cb20 (patch) | |
tree | 97027a278ef535cbb277ae91aa4c2eb620cb6978 /Source/cmMakefileExecutableTargetGenerator.cxx | |
parent | fa3ac83af0edf958d26b246109db6e3d6d128d70 (diff) | |
download | CMake-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/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 90d8c7f..ebc771b 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -617,7 +617,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); cmakeCommand += " -E __run_co_compile --lwyu="; cmakeCommand += targetOutPathReal; - real_link_commands.push_back(cmakeCommand); + real_link_commands.push_back(std::move(cmakeCommand)); } std::string launcher; @@ -666,7 +666,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) symlink += targetOutPathReal; symlink += " "; symlink += targetOutPath; - commands1.push_back(symlink); + commands1.push_back(std::move(symlink)); this->LocalGenerator->CreateCDCommand( commands1, this->Makefile->GetCurrentBinaryDirectory(), this->LocalGenerator->GetBinaryDirectory()); |