Removed another nested function by duplicating iterator code.

This commit is contained in:
Cas Cremers 2018-10-14 20:42:54 +02:00
parent 7956eb5953
commit 2ad030f919

View File

@ -415,16 +415,22 @@ int
iterate_preceding_bindings (const int run, const int ev, iterate_preceding_bindings (const int run, const int ev,
int (*func) (Binding b)) int (*func) (Binding b))
{ {
int precs (Binding b) List bl;
for (bl = sys->bindings; bl != NULL; bl = bl->next)
{ {
Binding b;
b = (Binding) bl->data;
if (isDependEvent (b->run_to, b->ev_to, run, ev)) if (isDependEvent (b->run_to, b->ev_to, run, ev))
{ {
return func (b); if (!func (b))
{
return false;
}
}
} }
return true; return true;
}
return iterate_bindings (precs);
} }