From 5c953a3d08d1e031b7632d9e18d10a3daea2141d Mon Sep 17 00:00:00 2001 From: Jack Firth Date: Wed, 30 Mar 2022 02:16:06 -0700 Subject: [PATCH] Use `hash-update!` --- parser-tools/private-lex/deriv.rkt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/parser-tools/private-lex/deriv.rkt b/parser-tools/private-lex/deriv.rkt index 77b7488..7f597e3 100644 --- a/parser-tools/private-lex/deriv.rkt +++ b/parser-tools/private-lex/deriv.rkt @@ -263,11 +263,7 @@ (set! new-state? #t) (state new-re (get-state-number))))] [new-all-states (if new-state? (cons new-state all-states) all-states)]) - (hash-set! transitions - s - (cons (cons c new-state) - (hash-ref transitions s - '()))) + (hash-update! transitions s (λ (v) (cons (cons c new-state) v)) '()) (cond [new-state? (loop old-states (cons new-state new-states) new-all-states (cdr cs))]