Clean up empty entries in subscription-matches
This commit is contained in:
parent
e03c8267dd
commit
58231b253f
|
@ -263,7 +263,9 @@
|
||||||
(define old-matches (subscription-matches sub))
|
(define old-matches (subscription-matches sub))
|
||||||
(define old-match-holders (hash-ref old-matches captures set))
|
(define old-match-holders (hash-ref old-matches captures set))
|
||||||
(define new-match-holders (set-remove old-match-holders linkid))
|
(define new-match-holders (set-remove old-match-holders linkid))
|
||||||
(define new-matches (hash-set old-matches captures new-match-holders))
|
(define new-matches (if (set-empty? new-match-holders)
|
||||||
|
(hash-remove old-matches captures)
|
||||||
|
(hash-set old-matches captures new-match-holders)))
|
||||||
(store-sub! (struct-copy subscription sub [matches new-matches]))
|
(store-sub! (struct-copy subscription sub [matches new-matches]))
|
||||||
(match (set-count new-match-holders)
|
(match (set-count new-match-holders)
|
||||||
[0 (for [((peer peer-subid) (in-hash (subscription-holders sub)))]
|
[0 (for [((peer peer-subid) (in-hash (subscription-holders sub)))]
|
||||||
|
|
Loading…
Reference in New Issue