Skip to content

Commit bf2ba33

Browse files
committed
add a check to avoid traversing repeated parts of an origin field
1 parent 109f7c3 commit bf2ba33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drracket-tool-text-lib/drracket/private/syncheck/traversals.rkt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,11 +1394,14 @@
13941394

13951395
;; add-origins : syntax? id-set exact-integer? -> void
13961396
(define (add-origins stx id-set level-of-enclosing-module collect-general-info)
1397+
(define did-already (make-hasheq))
13971398
(let loop ([ct (syntax-property stx 'origin)])
13981399
(match ct
13991400
[(cons hd tl)
1400-
(loop hd)
1401-
(loop tl)]
1401+
(unless (hash-ref did-already ct #f)
1402+
(hash-set! did-already ct #t)
1403+
(loop hd)
1404+
(loop tl))]
14021405
[(? identifier?)
14031406
(collect-general-info ct)
14041407
(add-id id-set ct level-of-enclosing-module)]

0 commit comments

Comments
 (0)