Skip to content

Commit

Permalink
perf: fix linearity issue in insertIfNew
Browse files Browse the repository at this point in the history
  • Loading branch information
hargoniX committed Apr 11, 2024
1 parent 68e3982 commit faab75b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Lean/Data/HashMap.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit faab75b

Please sign in to comment.