diff options
author | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-03 20:59:27 +0000 |
---|---|---|
committer | Peter Mikkelsen <peter@pmikkelsen.com> | 2021-07-03 20:59:27 +0000 |
commit | 66a7040df6897e60ee1a513b95f4b04e687bbf0a (patch) | |
tree | 501f486728cc1fd27b24a6227a131ad72684df84 /eval.c | |
parent | 7db38904537603dabe960f32fa505e27db89e27b (diff) |
Add one global choicestack so we don't need to pass it around
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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; } |