Skip to content

Commit 58c64b9

Browse files
Fix 2 occurrences of if-else-false-to-and
This `if` expression can be refactored to an equivalent expression using `and`.
1 parent a504971 commit 58c64b9

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

typed-racket-lib/typed-racket/env/global-env.rkt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@
7575

7676
(define (maybe-finish-register-type id)
7777
(define v (free-id-table-ref the-mapping id))
78-
(if (box? v)
79-
(register-type id (unbox v))
80-
#f))
78+
(and (box? v) (register-type id (unbox v))))
8179

8280
(define (unregister-type id)
8381
(free-id-table-remove! the-mapping id))

typed-racket-lib/typed-racket/env/init-envs.rkt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,9 @@
437437

438438
(define (bound-in-this-module id)
439439
(define binding (identifier-binding id))
440-
(if (and (list? binding) (module-path-index? (car binding)))
441-
(let-values ([(mp base) (module-path-index-split (car binding))])
442-
(not mp))
443-
#f))
440+
(and (and (list? binding) (module-path-index? (car binding)))
441+
(let-values ([(mp base) (module-path-index-split (car binding))])
442+
(not mp))))
444443

445444
(define (make-init-code map f)
446445
(define (bound-f id v)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy