Revert "Use `hash-update!` where possible"

This reverts commit 43d9632859.
remotes/jackfirth/master
Jack Firth 3 years ago
parent 43d9632859
commit dea323686f

@ -263,7 +263,11 @@
(set! new-state? #t)
(state new-re (get-state-number))))]
[new-all-states (if new-state? (cons new-state all-states) all-states)])
(hash-update! transitions s (λ (v) (cons (cons c new-state) v)) '())
(hash-set! transitions
s
(cons (cons c new-state)
(hash-ref transitions s
'())))
(cond
[new-state?
(loop old-states (cons new-state new-states) new-all-states (cdr cs))]

@ -59,7 +59,7 @@
(define (reverse-assoc assoc)
(define reverse-hash (make-hash))
(define (hash-table-add! ht k v)
(hash-update! ht k (λ (v) (cons v v)) '()))
(hash-set! ht k (cons v (hash-ref ht k '()))))
(for ([trans-key/kernel (in-list assoc)])
(define tk (car trans-key/kernel))
(hash-table-add! reverse-hash

Loading…
Cancel
Save