1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-15 20:46:37 +08: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:
Pavel Solodovnikov
2018-01-25 16:59:33 +03:00
parent fa3ac83af0
commit c85bb007df
69 changed files with 303 additions and 315 deletions

View File

@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <utility>
int cmDependsJava_yyparse(yyscan_t yyscanner);
@@ -22,7 +23,7 @@ cmDependsJavaParserHelper::cmDependsJavaParserHelper()
CurrentClass tl;
tl.Name = "*";
this->ClassStack.push_back(tl);
this->ClassStack.push_back(std::move(tl));
}
cmDependsJavaParserHelper::~cmDependsJavaParserHelper()
@@ -175,7 +176,7 @@ void cmDependsJavaParserHelper::StartClass(const char* cls)
{
CurrentClass cl;
cl.Name = cls;
this->ClassStack.push_back(cl);
this->ClassStack.push_back(std::move(cl));
this->CurrentDepth++;
}