From 66a7040df6897e60ee1a513b95f4b04e687bbf0a Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Sat, 3 Jul 2021 20:59:27 +0000 Subject: Add one global choicestack so we don't need to pass it around --- eval.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 17ee5d1..0fc5f18 100644 --- a/eval.c +++ b/eval.c @@ -14,10 +14,9 @@ Builtin findbuiltin(Term *); static uvlong clausenr; int -evalquery(Term *database, Term *query, Binding **resultbindings, Choicepoint **resultchoicestack) +evalquery(Term *database, Term *query, Binding **resultbindings) { Goal *goals; - Choicepoint *choicestack = *resultchoicestack; if(choicestack == nil){ /* @@ -66,7 +65,7 @@ Retry: /* Try to see if the goal can be solved using a builtin first */ Builtin builtin = findbuiltin(goal); if(builtin != nil){ - int success = builtin(database, goal, &goals->next, &choicestack, &bindings); + int success = builtin(database, goal, &goals->next, &bindings); if(!success) goto Backtrack; }else{ @@ -115,7 +114,6 @@ Backtrack: } goals = goals->next; unify(query, goals->goal, resultbindings); - *resultchoicestack = choicestack; return 1; } -- cgit v1.2.3