Skip to content

Commit 27d2d5e

Browse files
Fix 1 occurrence of let-to-define
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
1 parent 9d3e2e6 commit 27d2d5e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

typed-racket-lib/typed-racket/infer/infer-unit.rkt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -948,13 +948,13 @@
948948
(for/hash ([(k v) (in-hash cmap)])
949949
(values k (t-subst (constraint->type v (hash-ref var-hash k variance:const))))))]
950950
[subst (for/fold ([subst subst]) ([v (in-list X)])
951-
(let ([entry (hash-ref subst v #f)])
952-
;; Make sure we got a subst entry for a type var
953-
;; (i.e. just a type to substitute)
954-
;; If we don't have one, there are no constraints on this variable
955-
(if (and entry (t-subst? entry))
956-
subst
957-
(hash-set subst v (t-subst Univ)))))])
951+
(define entry (hash-ref subst v #f))
952+
;; Make sure we got a subst entry for a type var
953+
;; (i.e. just a type to substitute)
954+
;; If we don't have one, there are no constraints on this variable
955+
(if (and entry (t-subst? entry))
956+
subst
957+
(hash-set subst v (t-subst Univ))))])
958958
;; verify that we got all the important variables
959959
(extend-idxs subst)))
960960
(if multiple-substitutions?

0 commit comments

Comments
 (0)