diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-04-01 14:56:14 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-04-01 14:56:14 (GMT) |
commit | abe52429a36e209b7fdd97c3ae87e43b07081aa8 (patch) | |
tree | da7fb025e010d3a594a9c517ff73bf896616821a | |
parent | 9900cb3b3884fbd5199fa7c1060b4cd3b7514b8f (diff) | |
download | Ninja-abe52429a36e209b7fdd97c3ae87e43b07081aa8.zip Ninja-abe52429a36e209b7fdd97c3ae87e43b07081aa8.tar.gz Ninja-abe52429a36e209b7fdd97c3ae87e43b07081aa8.tar.bz2 |
Cleanup: Don't modify during cycle checking.
-rw-r--r-- | src/build.cc | 8 |
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; } |