fix id-set-symmetric-difference, same as 4716a6e fixed for sets

This commit is contained in:
Milo Turner 2017-05-24 13:50:12 -04:00 committed by Stephen Chang
parent 7620bfcb7c
commit cc25a27f87
2 changed files with 5 additions and 1 deletions

View File

@ -322,6 +322,10 @@
(define ABCDE/MUTABLE (mk-mutable-id-set ABCDE-LIST))
(define ABCDE/IMMUTABLE (mk-immutable-id-set ABCDE-LIST))
(test 0 SET-COUNT
(SET-SYMMETRIC-DIFFERENCE ABCDE/IMMUTABLE ABCDE/IMMUTABLE))
(test 0 SET-COUNT
(SET-SYMMETRIC-DIFFERENCE ABCDE/IMMUTABLE (mk-immutable-id-set ABCDE-LIST)))
(test 5 SET-COUNT (SET-SYMMETRIC-DIFFERENCE ABCDE/IMMUTABLE))
(test #t SET-EMPTY? (SET-SYMMETRIC-DIFFERENCE EMPTY/IMMUTABLE))
(test 4 SET-COUNT (SET-SYMMETRIC-DIFFERENCE EMPTY/IMMUTABLE ABCD))

View File

@ -277,7 +277,7 @@
(immutable-id-set
(for/fold
([table (id-set-get-table largest-immutable)])
([s (in-list (cons set0 ss))] #:unless (eq? s largest-immutable))
([s (in-list (remq largest-immutable (cons set0 ss)))])
(for/fold ([table table])
([id (in-dict-keys (id-set-get-table s))])
(if (id-table-ref table id #f)