Clean up empty entries in subscription-matches
This commit is contained in:
parent
b5bae7f8f6
commit
5f766d5b12
|
@ -263,7 +263,9 @@
|
|||
(define old-matches (subscription-matches sub))
|
||||
(define old-match-holders (hash-ref old-matches captures set))
|
||||
(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]))
|
||||
(match (set-count new-match-holders)
|
||||
[0 (for [((peer peer-subid) (in-hash (subscription-holders sub)))]
|
||||
|
|
Loading…
Reference in New Issue