simplify detection of cycles in printer

This commit is contained in:
Mark Thom
2018-05-05 13:20:06 -06:00
parent 81a199836d
commit 885d7c04e3
5 changed files with 15 additions and 63 deletions

View File

@@ -221,7 +221,6 @@ pub struct MachineState {
pub(super) hb: usize,
pub(super) block: usize, // an offset into the OR stack.
pub(super) ball: Ball,
pub(super) redirect: CellRedirect,
pub(super) interms: Vec<Number>, // intermediate numbers.
}

View File

@@ -50,7 +50,6 @@ impl MachineState {
hb: 0,
block: 0,
ball: Ball::new(),
redirect: CellRedirect::new(),
interms: vec![Number::default(); 256]
}
}
@@ -1618,9 +1617,9 @@ impl MachineState {
let addr = self[temp_v!(1)].clone();
self.ball.boundary = self.heap.h;
self.redirect = {
{
let mut duplicator = DuplicateBallTerm::new(self);
duplicator.duplicate_term_and_redirect(addr)
duplicator.duplicate_term(addr);
};
self.p += 1;
@@ -2333,6 +2332,5 @@ impl MachineState {
self.block = 0;
self.ball.reset();
self.redirect.clear();
}
}