From: Mark Thom Date: Wed, 2 Oct 2019 04:36:46 +0000 (-0600) Subject: eliminate extraneous choice point in $get_attr X-Git-Tag: v0.8.110~30 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=c0ad3231f5b8c0c7f5dbfd3ff9824cb4a54e3d98;p=scryer-prolog.git eliminate extraneous choice point in $get_attr --- diff --git a/src/prolog/lib/atts.pl b/src/prolog/lib/atts.pl index 6f3b109b..868ef4ae 100644 --- a/src/prolog/lib/atts.pl +++ b/src/prolog/lib/atts.pl @@ -24,7 +24,7 @@ '$get_from_list'([L|Ls], V, Attr) :- nonvar(L), ( L \= Attr -> nonvar(Ls), '$get_from_list'(Ls, V, Attr) - ; L = Attr, '$enqueue_attr_var'(V) + ; L = Attr -> '$enqueue_attr_var'(V) ; '$get_from_list'(Ls, V, Attr) ). diff --git a/src/prolog/machine/system_calls.rs b/src/prolog/machine/system_calls.rs index ba2eef93..91afb248 100644 --- a/src/prolog/machine/system_calls.rs +++ b/src/prolog/machine/system_calls.rs @@ -1252,7 +1252,7 @@ impl MachineState { &SystemClauseType::GetAttributedVariableList => { let attr_var = self.store(self.deref(self[temp_v!(1)].clone())); let attr_var_list = match attr_var { - Addr::AttrVar(h) => h + 1, + Addr::AttrVar(h) => h + 1, attr_var @ Addr::HeapCell(_) | attr_var @ Addr::StackCell(..) => { // create an AttrVar in the heap. let h = self.heap.h;