Skip to content

Commit 5249e70

Browse files
committed
Use updateFullArray where possible
1 parent 797d699 commit 5249e70

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Data/HashMap/Internal.hs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ delete'' = go
11431143
let ary' = A.delete ary i
11441144
bm = fullBitmap .&. complement (1 `unsafeShiftL` i)
11451145
in BitmapIndexed bm ary'
1146-
_ -> Full (A.update ary i st')
1146+
_ -> Full (updateFullArray ary i st')
11471147
where i = index h s
11481148
go h k _ t@(Collision hy v)
11491149
| h == hy = case indexOf k v of
@@ -1192,7 +1192,7 @@ deleteKeyExists !collPos0 !h0 !k0 !m0 = go collPos0 h0 k0 m0
11921192
let ary' = A.delete ary i
11931193
bm = fullBitmap .&. complement (1 `unsafeShiftL` i)
11941194
in BitmapIndexed bm ary'
1195-
_ -> Full (A.update ary i st')
1195+
_ -> Full (updateFullArray ary i st')
11961196
where i = indexSH shiftedHash
11971197
go collPos _shiftedHash _k (Collision h v)
11981198
| A.length v == 2
@@ -1853,9 +1853,7 @@ Or maybe this helps avoid more evaluations later on? (Check Cmm)
18531853
bm = fullBitmap .&. complement (1 `unsafeShiftL` i)
18541854
in BitmapIndexed bm ary1'
18551855
st' | st `ptrEq` st' -> t1
1856-
-- TODO: Should probably use updateFullArray
1857-
-- (and in other places too!)
1858-
| otherwise -> Full (A.update ary1 i st')
1856+
| otherwise -> Full (updateFullArray ary1 i st')
18591857
where i = index h2 s
18601858

18611859
-- TODO: Why does $wdifferenceCollisions appear three times in the Core

0 commit comments

Comments
 (0)