Skip to content

Commit 478bb60

Browse files
authored
Remove some unnecessary forcing of HashMaps (#545)
This reduces the Core size for the affected functions but doesn't change their demand signatures.
1 parent ebb5c13 commit 478bb60

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Data/HashMap/Internal.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ lookupCont ::
709709
-> k
710710
-> Shift
711711
-> HashMap k v -> r
712-
lookupCont absent present !h0 !k0 !s0 !m0 = go h0 k0 s0 m0
712+
lookupCont absent present !h0 !k0 !s0 m0 = go h0 k0 s0 m0
713713
where
714714
go :: Eq k => Hash -> k -> Shift -> HashMap k v -> r
715715
go !_ !_ !_ Empty = absent (# #)
@@ -846,7 +846,7 @@ insert' h0 k0 v0 m0 = go h0 k0 v0 0 m0
846846
-- - the key equality check on a Leaf
847847
-- - check for its existence in the array for a hash collision
848848
insertNewKey :: Hash -> k -> v -> HashMap k v -> HashMap k v
849-
insertNewKey !h0 !k0 x0 !m0 = go h0 k0 x0 0 m0
849+
insertNewKey !h0 !k0 x0 m0 = go h0 k0 x0 0 m0
850850
where
851851
go !h !k x !_ Empty = Leaf h (L k x)
852852
go h k x s t@(Leaf hy l)
@@ -883,7 +883,7 @@ insertNewKey !h0 !k0 x0 !m0 = go h0 k0 x0 0 m0
883883
-- from 'lookupRecordCollision'. If there is no collision, pass (-1) as collPos
884884
-- (first argument).
885885
insertKeyExists :: Int -> Hash -> k -> v -> HashMap k v -> HashMap k v
886-
insertKeyExists !collPos0 !h0 !k0 x0 !m0 = go collPos0 h0 k0 x0 m0
886+
insertKeyExists !collPos0 !h0 !k0 x0 m0 = go collPos0 h0 k0 x0 m0
887887
where
888888
go !_collPos !_shiftedHash !k x (Leaf h _kx)
889889
= Leaf h (L k x)
@@ -1170,7 +1170,7 @@ deleteFromSubtree h k _ t@(Collision hy v)
11701170
-- hash collision position if there was one. This information can be obtained
11711171
-- from 'lookupRecordCollision'. If there is no collision, pass (-1) as collPos.
11721172
deleteKeyExists :: Int -> Hash -> k -> HashMap k v -> HashMap k v
1173-
deleteKeyExists !collPos0 !h0 !k0 !m0 = go collPos0 h0 k0 m0
1173+
deleteKeyExists !collPos0 !h0 !k0 m0 = go collPos0 h0 k0 m0
11741174
where
11751175
go :: Int -> ShiftedHash -> k -> HashMap k v -> HashMap k v
11761176
go !_collPos !_shiftedHash !_k (Leaf _ _) = Empty

0 commit comments

Comments
 (0)