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,
int (*func) (Binding b))
{
int precs (Binding b)
{
if (isDependEvent (b->run_to, b->ev_to, run, ev))
{
return func (b);
}
return true;
}
List bl;
return iterate_bindings (precs);
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 (!func (b))
{
return false;
}
}
}
return true;
}