From 38bb02aa61ee16f937bf56a2b278c3c7fc69b018 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Fri, 19 Oct 2018 15:33:41 -0400 Subject: [PATCH] Removed another simple trampoline. --- src/label.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/label.c b/src/label.c index 3421c52..7adcc2e 100644 --- a/src/label.c +++ b/src/label.c @@ -78,28 +78,22 @@ label_destroy (Labelinfo linfo) Labelinfo label_find (List labellist, const Term label) { - Labelinfo linfo; + List ll; - int label_find_scan (void *data) - { - Labelinfo linfo_scan; - - linfo_scan = (Labelinfo) data; - if (isTermEqual (label, linfo_scan->label)) - { - linfo = linfo_scan; - return 0; - } - else - { - return 1; - } - } - - linfo = NULL; - if (label != NULL) + if (label == NULL) { - list_iterate (labellist, label_find_scan); + return NULL; } - return linfo; + + for (ll = labellist; ll != NULL; ll = ll->next) + { + Labelinfo linfo; + + linfo = (Labelinfo) ll->data; + if (isTermEqual (label, linfo->label)) + { + return linfo; + } + } + return NULL; }