Skip to content

Commit acfb15f

Browse files
committed
Avoid code duplication in insert
The call to Array.insert was duplicated in both branches of bitmapIndexedOrFull, due to being lazily evaluated. Fixes #76.
1 parent f25d8ac commit acfb15f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Data/HashMap/Base.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ insert k0 v0 m0 = go h0 k0 v0 0 m0
314314
| otherwise = runST (two s h k x hy ky y)
315315
go h k x s t@(BitmapIndexed b ary)
316316
| b .&. m == 0 =
317-
let ary' = A.insert ary i $! Leaf h (L k x)
317+
let !ary' = A.insert ary i $! Leaf h (L k x)
318318
in bitmapIndexedOrFull (b .|. m) ary'
319319
| otherwise =
320320
let !st = A.index ary i

0 commit comments

Comments
 (0)