mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Reduce allocation of temporary values on heap.
- Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "cmGeneratedFileStream.h"
|
||||
@@ -90,7 +91,7 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
|
||||
if (depends.empty() && commands.empty()) {
|
||||
std::string hack = this->GlobalGenerator->GetEmptyRuleHackDepends();
|
||||
if (!hack.empty()) {
|
||||
depends.push_back(hack);
|
||||
depends.push_back(std::move(hack));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user