Skip to content

Commit 5dcdb5f

Browse files
Fix 1 occurrence of cond-else-if-to-cond
The `else`-`if` branch of this `cond` expression can be collapsed into the `cond` expression.
1 parent 007f69f commit 5dcdb5f

File tree

1 file changed

+4
-6
lines changed
  • typed-racket-lib/typed-racket/static-contracts/combinators

1 file changed

+4
-6
lines changed

typed-racket-lib/typed-racket/static-contracts/combinators/simple.rkt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@
3535
;;
3636
;; Note: does not handle cycles but there shouldn't be any
3737
(define (stx-equal? s1 s2)
38-
(cond [(and (identifier? s1) (identifier? s2))
39-
(free-identifier=? s1 s2)]
40-
[else
41-
(if (and (syntax? s1) (syntax? s2))
42-
(equal?/recur (syntax-e s1) (syntax-e s2) stx-equal?)
43-
(equal?/recur s1 s2 stx-equal?))]))
38+
(cond
39+
[(and (identifier? s1) (identifier? s2)) (free-identifier=? s1 s2)]
40+
[(and (syntax? s1) (syntax? s2)) (equal?/recur (syntax-e s1) (syntax-e s2) stx-equal?)]
41+
[else (equal?/recur s1 s2 stx-equal?)]))
4442

4543
(struct simple-contract static-contract (syntax kind name)
4644
#:transparent

0 commit comments

Comments
 (0)