From d02b9d848cfd47b40d20b9834b2fcfc96738bb98 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Thu, 25 Nov 2021 23:08:02 -0700 Subject: [PATCH] break from loop upon successful peek in peek_char/1 and peek_code/1 --- src/machine/system_calls.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index a35a65e8..3d33d921 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -1512,6 +1512,7 @@ impl MachineState { match stream.peek_char().map(|result| result.map_err(|e| e.kind())) { Some(Ok(d)) => { self.unify_char(d, a2); + break; } Some(Err(ErrorKind::PermissionDenied)) => { self.fail = true; @@ -1614,6 +1615,7 @@ impl MachineState { match result.map(|result| result.map_err(|e| e.kind())) { Some(Ok(c)) => { self.unify_fixnum(Fixnum::build_with(c as i64), addr); + break; } Some(Err(ErrorKind::PermissionDenied)) => { self.fail = true; -- 2.54.0