Cleanup: Don't search stack for cycle elements twice.
authorNico Weber <nicolasweber@gmx.de>
Wed, 1 Apr 2015 15:00:27 +0000 (08:00 -0700)
committerNico Weber <nicolasweber@gmx.de>
Wed, 1 Apr 2015 15:00:27 +0000 (08:00 -0700)
commit90621fd177660f94aa27ce5963506f814f859da2
tree6c9aac067cea4e6dbc7c49da6f9839de4bf99c76
parent813205b43c63239c7e37f9e296d345d55b12d565
Cleanup: Don't search stack for cycle elements twice.

The common case is that there is no cycle.  In that case,
CheckDependencyCycle() searched the stack for a dupe from the back,
wouldn't find one, and return false.

If there was a cycle, it would then search again from the front
(probably because the push_back() that used to be here would invalidate
the ri iterator).

Since the push_back() is gone, just search from the front once. No
intended behavior change.
src/build.cc