diff options
author | Brad King <brad.king@kitware.com> | 2015-08-07 15:24:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-04-18 12:21:44 (GMT) |
commit | 083a9e2e7af813571444e33fad5f0f373bce7e3f (patch) | |
tree | 9f22771d45526d579e6307a5e914414ee90b7194 /src/build.cc | |
parent | 64acb1a22b1001df96a4dfb7f36c16d7f56df392 (diff) | |
download | Ninja-083a9e2e7af813571444e33fad5f0f373bce7e3f.zip Ninja-083a9e2e7af813571444e33fad5f0f373bce7e3f.tar.gz Ninja-083a9e2e7af813571444e33fad5f0f373bce7e3f.tar.bz2 |
Factor out output edge ready check from Plan::NodeFinished
Move the logic to a new Plan::EdgeMaybeReady method so it can be re-used
elsewhere.
Diffstat (limited to 'src/build.cc')
-rw-r--r-- | src/build.cc | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/build.cc b/src/build.cc index 7b53a5d..a07d970 100644 --- a/src/build.cc +++ b/src/build.cc @@ -418,15 +418,22 @@ bool Plan::NodeFinished(Node* node, string* err) { continue; // See if the edge is now ready. - if ((*oe)->AllInputsReady()) { - if (want_e->second != kWantNothing) { - ScheduleWork(want_e); - } else { - // We do not need to build this edge, but we might need to build one of - // its dependents. - if (!EdgeFinished(*oe, kEdgeSucceeded, err)) - return false; - } + if (!EdgeMaybeReady(want_e, err)) + return false; + } + return true; +} + +bool Plan::EdgeMaybeReady(map<Edge*, Want>::iterator want_e, string* err) { + Edge* edge = want_e->first; + if (edge->AllInputsReady()) { + if (want_e->second != kWantNothing) { + ScheduleWork(want_e); + } else { + // We do not need to build this edge, but we might need to build one of + // its dependents. + if (!EdgeFinished(edge, kEdgeSucceeded, err)) + return false; } } return true; |