From: Mark Thom Date: Fri, 26 Nov 2021 06:08:02 +0000 (-0700) Subject: break from loop upon successful peek in peek_char/1 and peek_code/1 X-Git-Tag: v0.9.0^2~117 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=d02b9d848cfd47b40d20b9834b2fcfc96738bb98;p=scryer-prolog.git break from loop upon successful peek in peek_char/1 and peek_code/1 --- 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;