summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-04-01 07:56:14 -0700
committerNico Weber <nicolasweber@gmx.de>2015-04-01 07:56:14 -0700
commitabe52429a36e209b7fdd97c3ae87e43b07081aa8 (patch)
treeda7fb025e010d3a594a9c517ff73bf896616821a
parent9900cb3b3884fbd5199fa7c1060b4cd3b7514b8f (diff)
downloadninja-abe52429a36e209b7fdd97c3ae87e43b07081aa8.tar.gz
Cleanup: Don't modify during cycle checking.
-rw-r--r--src/build.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/build.cc b/src/build.cc
index d898929..574aecc 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -322,17 +322,13 @@ bool Plan::CheckDependencyCycle(Node* node, vector<Node*>* stack, string* err) {
if (ri == stack->rend())
return false;
- // Add this node onto the stack to make it clearer where the loop
- // is.
- stack->push_back(node);
-
vector<Node*>::iterator start = find(stack->begin(), stack->end(), node);
*err = "dependency cycle: ";
for (vector<Node*>::iterator i = start; i != stack->end(); ++i) {
- if (i != start)
- err->append(" -> ");
err->append((*i)->path());
+ err->append(" -> ");
}
+ err->append(node->path());
return true;
}