get rid of the scope hack

master
Daniel Kolesa 2015-11-03 18:34:16 +00:00
parent c8112a4f59
commit 201e57916c
1 changed files with 4 additions and 10 deletions

14
main.cc
View File

@ -202,15 +202,9 @@ struct ObState {
int exec_func(ConstCharRange tname, const Vector<SubRule> &rlist) { int exec_func(ConstCharRange tname, const Vector<SubRule> &rlist) {
Vector<String> subdeps; Vector<String> subdeps;
/* new scope for early destruction */ int ret = RuleCounter(counters)
{ .wait_result(counters, exec_list(rlist, subdeps, tname));
RuleCounter depcnt(counters); if (!ret && ob_check_exec(tname, subdeps)) {
int r = depcnt.wait_result(counters, exec_list(rlist, subdeps,
tname));
if (r)
return r;
}
if (ob_check_exec(tname, subdeps)) {
Uint32 *func = nullptr; Uint32 *func = nullptr;
for (auto &sr: rlist.iter()) { for (auto &sr: rlist.iter()) {
Rule &r = *sr.rule; Rule &r = *sr.rule;
@ -250,7 +244,7 @@ struct ObState {
return cs.run_int(func); return cs.run_int(func);
} }
} }
return 0; return ret;
} }
int exec_action(Rule *rule) { int exec_action(Rule *rule) {