Skip to content

Commit 813d57c

Browse files
authored
Remove some dead code from insertKeyExists (#456)
The code was handling the case where a BitmapIndexed node does not have a sub-node that could contain the known-to-exist key.
1 parent 008c345 commit 813d57c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Data/HashMap/Internal.hs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -881,14 +881,10 @@ insertKeyExists !collPos0 !h0 !k0 x0 !m0 = go collPos0 h0 k0 x0 0 m0
881881
where
882882
go !_collPos !h !k x !_s (Leaf _hy _kx)
883883
= Leaf h (L k x)
884-
go collPos h k x s (BitmapIndexed b ary)
885-
| b .&. m == 0 =
886-
let !ary' = A.insert ary i $ Leaf h (L k x)
887-
in bitmapIndexedOrFull (b .|. m) ary'
888-
| otherwise =
889-
let !st = A.index ary i
890-
!st' = go collPos h k x (nextShift s) st
891-
in BitmapIndexed b (A.update ary i st')
884+
go collPos h k x s (BitmapIndexed b ary) =
885+
let !st = A.index ary i
886+
!st' = go collPos h k x (nextShift s) st
887+
in BitmapIndexed b (A.update ary i st')
892888
where m = mask h s
893889
i = sparseIndex b m
894890
go collPos h k x s (Full ary) =

0 commit comments

Comments
 (0)