From 27cf7b6a57bf8d4752a6258e89a047095841d189 Mon Sep 17 00:00:00 2001 From: tA Date: Thu, 11 Jun 2020 17:20:26 +1200 Subject: [PATCH] slight refactor of single function --- vm.rkt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vm.rkt b/vm.rkt index 1dd27b9..b025297 100644 --- a/vm.rkt +++ b/vm.rkt @@ -165,11 +165,13 @@ (lambda (m) (let ([c (get-carry m)] [z (get-zero m)]) - (case cc - [(NZ) (if (not z) (set-pc addr m) m)] - [(Z) (if z (set-pc addr) m)] - [(NC) (if (not c) (set-pc addr) m)] - [(C) (if c (set-pc addr) m)])))) + (if (case cc + [(NZ) (not z)] + [(Z) z] + [(NC) (not c)] + [(C) c]) + (set-pc addr m) + m)))) (define (jp-uncond addr) (lambda (m)