From 06b9c78403983686070832672177b0e3d8398fa6 Mon Sep 17 00:00:00 2001 From: NoahStoryM Date: Sun, 25 Apr 2021 23:06:21 +0800 Subject: [PATCH] Refine hash table's type. --- math-lib/math/private/statistics/counting.rkt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/math-lib/math/private/statistics/counting.rkt b/math-lib/math/private/statistics/counting.rkt index 00cc3fe..57bcf14 100644 --- a/math-lib/math/private/statistics/counting.rkt +++ b/math-lib/math/private/statistics/counting.rkt @@ -19,7 +19,7 @@ (: unweighted-samples->hash (All (A) ((Sequenceof A) -> (HashTable A Positive-Integer)))) (define (unweighted-samples->hash xs) - (define: h : (HashTable A Positive-Integer) (make-hash)) + (define: h : (Mutable-HashTable A Positive-Integer) (make-hash)) (for: ([x : A xs]) (hash-set! h x (unsafe-fx+ 1 (hash-ref h x (λ () 0))))) h) @@ -28,7 +28,7 @@ -> (HashTable A Nonnegative-Real)))) (define (weighted-samples->hash xs ws) (let-values ([(xs ws) (sequences->weighted-samples 'samples->hash xs ws)]) - (define: h : (HashTable A Nonnegative-Real) (make-hash)) + (define: h : (Mutable-HashTable A Nonnegative-Real) (make-hash)) (for: ([x : A xs] [w : Nonnegative-Real ws]) (hash-set! h x (+ w (hash-ref h x (λ () 0))))) h))