ADDED: '$first_non_octet'/2, for much more efficient domain checks in library(crypto).
'$first_non_octet'(Cs, C) <=> C is the leftmost character in the string Cs whose character code is not in 0..255.
This commit is contained in:
@@ -5340,6 +5340,18 @@ impl MachineState {
|
||||
let cstr = self.heap.put_complete_string(&string);
|
||||
(self.unify_fn)(self, self[temp_v!(3)], cstr);
|
||||
}
|
||||
&SystemClauseType::FirstNonOctet => {
|
||||
for c in self.heap_pstr_iter(self[temp_v!(1)]).to_string().chars() {
|
||||
if c as u32 > 255 {
|
||||
let chars = clause_name!(String::from(c.to_string()), self.atom_tbl);
|
||||
let non_octet = self.heap.to_unifiable(HeapCellValue::Atom(chars, None));
|
||||
(self.unify_fn)(self, self[temp_v!(2)], non_octet);
|
||||
return return_from_clause!(self.last_call, self);
|
||||
}
|
||||
}
|
||||
self.fail = true;
|
||||
return Ok(());
|
||||
}
|
||||
&SystemClauseType::LoadHTML => {
|
||||
let string = self.heap_pstr_iter(self[temp_v!(1)]).to_string();
|
||||
let doc = select::document::Document::from_read(string.as_bytes()).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user