From 2a0cfb4dcc14b07c01158d721f463448c1147e8a Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sun, 1 Nov 2020 23:38:08 +0100 Subject: [PATCH] network,compact-tbf: Use for/hash instead of hash-filter. --- networks.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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