network,compact-tbf: Use for/hash instead of hash-filter.

This commit is contained in:
Sergiu Ivanov 2020-11-01 23:38:08 +01:00
parent f7e44df117
commit 2a0cfb4dcc

View File

@ -1526,7 +1526,9 @@
;;; are 0.
(define (compact-tbf tbf)
(tbf/state
(hash-filter (tbf/state-w tbf) #:predicate (compose not zero?))
(for/hash ([(k v) (in-hash (tbf/state-w tbf))]
#:unless (zero? v))
(values k v))
(tbf/state-θ tbf)))
(module+ test