From 08adc5b5183ec38a70f95f7b8e3bf322b9c7a0d5 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Sun, 14 Oct 2018 17:39:29 +0200 Subject: [PATCH] Removed a further nested function call. --- src/compiler.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/compiler.c b/src/compiler.c index a4e71ef..46b6b4e 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -124,21 +124,20 @@ compilerDone (void) Termlist compute_recv_variables (const Role r) { - Termlist tl; + Termlist tl = NULL; + Roledef rd; - int process_event (Roledef rd) - { - if (rd->type == RECV) - { - tl = termlistAddVariables (tl, rd->from); - tl = termlistAddVariables (tl, rd->to); - tl = termlistAddVariables (tl, rd->message); - } - return 1; - } - - tl = NULL; - roledef_iterate_events (r->roledef, process_event); + rd = r->roledef; + while (rd != NULL) + { + if (rd->type == RECV) + { + tl = termlistAddVariables (tl, rd->from); + tl = termlistAddVariables (tl, rd->to); + tl = termlistAddVariables (tl, rd->message); + } + rd = rd->next; + } return tl; }