remove compare_pstr_to_string and related result type

This commit is contained in:
Mark Thom
2025-04-17 20:20:38 -07:00
committed by Mark Thom
parent bf31d3f9a9
commit f3cd6326a3
3 changed files with 5 additions and 129 deletions

View File

@@ -619,20 +619,16 @@ impl Machine {
);
}
&Instruction::GetPartialString(Level::Shallow, ref string, RegType::Temp(t)) => {
use crate::machine::partial_string::HeapPStrIter;
let cell = self.deref_register(t);
read_heap_cell!(cell,
(HeapCellValueTag::PStrLoc) => {
self.machine_st.heap[0] = cell;
let iter = HeapPStrIter::new(&self.machine_st.heap, 0);
(HeapCellValueTag::PStrLoc, pstr_loc) => {
let heap_slice = &self.machine_st.heap.as_slice()[pstr_loc ..];
if iter.compare_pstr_to_string(string).is_none() {
return false;
match compare_pstr_slices(heap_slice, string.as_bytes()) {
PStrSegmentCmpResult::Continue(..) => offset += 1,
_ => return false,
}
offset += 1;
}
(HeapCellValueTag::Lis) => {
offset += 1;