summaryrefslogtreecommitdiffstats
path: root/src/manifest_parser.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-03-21 04:21:14 (GMT)
committerNico Weber <nicolasweber@gmx.de>2015-03-21 15:17:02 (GMT)
commit9aab00003c62f8d6b8142e6ecfe8f0aeefc81f74 (patch)
treed0fec490d0f5a3fbd930c70067a89eff4e619236 /src/manifest_parser.cc
parent4d44291739222e453421a237ff77d9e5daaa3dd4 (diff)
downloadNinja-9aab00003c62f8d6b8142e6ecfe8f0aeefc81f74.zip
Ninja-9aab00003c62f8d6b8142e6ecfe8f0aeefc81f74.tar.gz
Ninja-9aab00003c62f8d6b8142e6ecfe8f0aeefc81f74.tar.bz2
Preallocate edge node vectors. ~1% faster.
Diffstat (limited to 'src/manifest_parser.cc')
-rw-r--r--src/manifest_parser.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/manifest_parser.cc b/src/manifest_parser.cc
index 4e639d1..b747ad4 100644
--- a/src/manifest_parser.cc
+++ b/src/manifest_parser.cc
@@ -321,6 +321,7 @@ bool ManifestParser::ParseEdge(string* err) {
edge->pool_ = pool;
}
+ edge->outputs_.reserve(outs.size());
for (vector<EvalString>::iterator i = outs.begin(); i != outs.end(); ++i) {
string path = i->Evaluate(env);
string path_err;
@@ -337,6 +338,7 @@ bool ManifestParser::ParseEdge(string* err) {
return true;
}
+ edge->inputs_.reserve(ins.size());
for (vector<EvalString>::iterator i = ins.begin(); i != ins.end(); ++i) {
string path = i->Evaluate(env);
string path_err;