Compare commits

...

1 Commits

Author SHA1 Message Date
Henrik Böving
faab75b0d8 perf: fix linearity issue in insertIfNew 2024-04-11 14:34:17 +02:00

View File

@@ -122,7 +122,7 @@ def expand [Hashable α] (size : Nat) (buckets : HashMapBucket α β) : HashMapI
let i, h := mkIdx (hash a) buckets.property
let bkt := buckets.val[i]
if let some b := bkt.find? a then
(m, some b)
(size, buckets, some b)
else
let size' := size + 1
let buckets' := buckets.update i (AssocList.cons a b bkt) h