From 26bf50242832216f0d2ab039169174ae4b2dbe64 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Fri, 19 Oct 2018 15:18:17 -0400 Subject: [PATCH] Removed another trampoline. --- src/hidelevel.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/hidelevel.c b/src/hidelevel.c index 85eefba..9e48e7b 100644 --- a/src/hidelevel.c +++ b/src/hidelevel.c @@ -258,23 +258,30 @@ unsigned int hidelevelFlag (const System sys, const Term goalterm) { unsigned int flag; - - int getflag (unsigned int l, unsigned int lmin, unsigned int lprot, - unsigned int lknow) - { - // Determine new flag - flag = flag | hidelevelParamFlag (l, lmin, lprot, lknow); - - // Should we proceed? - if (flag == HLFLAG_NONE) - { - // abort iteration: it cannot get worse - return false; - } - return true; - } + Hiddenterm ht; flag = HLFLAG_BOTH; - iterate_interesting (sys, goalterm, getflag); + + for (ht = sys->hidden; ht != NULL; ht = ht->next) + { + unsigned int l; + // Test the goalterm for occurrences of this + + l = termHidelevel (ht->term, goalterm); + if (l < INT_MAX) + { + flag = + flag | hidelevelParamFlag (l, ht->hideminimum, ht->hideprotocol, + ht->hideknowledge); + + // Should we proceed? + if (flag == HLFLAG_NONE) + { + // abort iteration: it cannot get worse + return flag; + } + } + } + return flag; }