From 15c64c8a5586c4cf25c473665567e2d875d366ef Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Fri, 19 Oct 2018 16:06:08 -0400 Subject: [PATCH] Down to 20. --- src/system.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/system.c b/src/system.c index 5172b30..4fa2742 100644 --- a/src/system.c +++ b/src/system.c @@ -1110,16 +1110,22 @@ int iterateEventsType (const System sys, const int run, const int evtype, int (*callback) (Roledef rd, int ev)) { - int selectEvent (Roledef rd, int e) - { - if (evtype == ANYEVENT || rd->type == evtype) - { - return callback (rd, e); - } - return true; - } + int e; + Roledef rd; - return iterateEvents (sys, run, selectEvent); + rd = sys->runs[run].start; + for (e = 0; e < sys->runs[run].step; e++) + { + if (evtype == ANYEVENT || rd->type == evtype) + { + if (!callback (rd, e)) + { + return false; + } + } + rd = rd->next; + } + return true; } // Iterate over all 'others': local variables of a run that are instantiated and contain some term of another run.