eliminate extraneous choice point in $get_attr
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
'$get_from_list'([L|Ls], V, Attr) :-
|
'$get_from_list'([L|Ls], V, Attr) :-
|
||||||
nonvar(L),
|
nonvar(L),
|
||||||
( L \= Attr -> nonvar(Ls), '$get_from_list'(Ls, V, Attr)
|
( 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)
|
; '$get_from_list'(Ls, V, Attr)
|
||||||
).
|
).
|
||||||
|
|
||||||
|
|||||||
@@ -1252,7 +1252,7 @@ impl MachineState {
|
|||||||
&SystemClauseType::GetAttributedVariableList => {
|
&SystemClauseType::GetAttributedVariableList => {
|
||||||
let attr_var = self.store(self.deref(self[temp_v!(1)].clone()));
|
let attr_var = self.store(self.deref(self[temp_v!(1)].clone()));
|
||||||
let attr_var_list = match attr_var {
|
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(..) => {
|
attr_var @ Addr::HeapCell(_) | attr_var @ Addr::StackCell(..) => {
|
||||||
// create an AttrVar in the heap.
|
// create an AttrVar in the heap.
|
||||||
let h = self.heap.h;
|
let h = self.heap.h;
|
||||||
|
|||||||
Reference in New Issue
Block a user