diff --git a/networks.rkt b/networks.rkt index f16c72c..07da868 100644 --- a/networks.rkt +++ b/networks.rkt @@ -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