very minor optimizations
This commit is contained in:
@@ -79,4 +79,4 @@ modular-bitfield = { git = "https://github.com/mthom/modular-bitfield" }
|
||||
num-rug-adapter = { git = "https://github.com/mthom/num-rug-adapter" }
|
||||
|
||||
[profile.release]
|
||||
debug = true
|
||||
debug = true
|
||||
@@ -587,8 +587,6 @@ read(Term) :-
|
||||
current_input(Stream),
|
||||
read(Stream, Term).
|
||||
|
||||
% term_variables.
|
||||
|
||||
% ensures List is either a variable or a list.
|
||||
can_be_list(List, _) :-
|
||||
var(List),
|
||||
@@ -603,6 +601,8 @@ can_be_list(List, _) :-
|
||||
can_be_list(List, PI) :-
|
||||
throw(error(type_error(list, List), PI)).
|
||||
|
||||
% term_variables.
|
||||
|
||||
term_variables(Term, Vars) :-
|
||||
can_be_list(Vars, term_variables/2),
|
||||
'$term_variables'(Term, Vars).
|
||||
@@ -1375,13 +1375,14 @@ must_be_number(N, PI) :-
|
||||
; throw(error(instantiation_error, PI))
|
||||
).
|
||||
|
||||
can_be_chars_or_vars(Cs, _) :- var(Cs), !.
|
||||
can_be_chars_or_vars(Cs, _) :- var(Cs), !.
|
||||
can_be_chars_or_vars(Cs, PI) :- chars_or_vars(Cs, PI).
|
||||
|
||||
chars_or_vars([], _).
|
||||
chars_or_vars([C|Cs], PI) :-
|
||||
( nonvar(C) ->
|
||||
( catch(builtins:atom_length(C, 1), _, false) ->
|
||||
( atom(C),
|
||||
atom_length(C, 1) ->
|
||||
( nonvar(Cs) ->
|
||||
chars_or_vars(Cs, PI)
|
||||
; false
|
||||
|
||||
@@ -707,7 +707,7 @@ impl MachineState {
|
||||
indices: &IndexStore,
|
||||
stub_gen: impl Fn() -> FunctorStub,
|
||||
) -> CallResult {
|
||||
let nx = self.registers[2];
|
||||
let nx = self.store(self.deref(self.registers[2]));
|
||||
|
||||
if let Some(c) = string.chars().last() {
|
||||
if layout_char!(c) {
|
||||
|
||||
Reference in New Issue
Block a user