]> Repositorios git - scryer-prolog.git/commitdiff
eliminate extraneous choice point in $get_attr
authorMark Thom <[email protected]>
Wed, 2 Oct 2019 04:36:46 +0000 (22:36 -0600)
committerMark Thom <[email protected]>
Wed, 2 Oct 2019 04:36:46 +0000 (22:36 -0600)
src/prolog/lib/atts.pl
src/prolog/machine/system_calls.rs

index 6f3b109b924f73d7a1cd4e0fed357536855b8f89..868ef4aed78d0e51c2e0cbf347849529e484725c 100644 (file)
@@ -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)
     ).
 
index ba2eef93a8940d855a686036263265c8c793789e..91afb24869431d8a35f7db1c013771d503ef8a95 100644 (file)
@@ -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;