Skip to content

Commit afa7ebd

Browse files
committed
Remove some unnecessary forcing of HashMaps
This reduces the Core size for the affected functions but doesn't change their demand signatures.
1 parent 5ce9758 commit afa7ebd

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
@@ -708,7 +708,7 @@ lookupCont ::
708708
-> k
709709
-> Shift
710710
-> HashMap k v -> r
711-
lookupCont absent present !h0 !k0 !s0 !m0 = go h0 k0 s0 m0
711+
lookupCont absent present !h0 !k0 !s0 m0 = go h0 k0 s0 m0
712712
where
713713
go :: Eq k => Hash -> k -> Shift -> HashMap k v -> r
714714
go !_ !_ !_ Empty = absent (# #)
@@ -845,7 +845,7 @@ insert' h0 k0 v0 m0 = go h0 k0 v0 0 m0
845845
-- - the key equality check on a Leaf
846846
-- - check for its existence in the array for a hash collision
847847
insertNewKey :: Hash -> k -> v -> HashMap k v -> HashMap k v
848-
insertNewKey !h0 !k0 x0 !m0 = go h0 k0 x0 0 m0
848+
insertNewKey !h0 !k0 x0 m0 = go h0 k0 x0 0 m0
849849
where
850850
go !h !k x !_ Empty = Leaf h (L k x)
851851
go h k x s t@(Leaf hy l)
@@ -882,7 +882,7 @@ insertNewKey !h0 !k0 x0 !m0 = go h0 k0 x0 0 m0
882882
-- from 'lookupRecordCollision'. If there is no collision, pass (-1) as collPos
883883
-- (first argument).
884884
insertKeyExists :: Int -> Hash -> k -> v -> HashMap k v -> HashMap k v
885-
insertKeyExists !collPos0 !h0 !k0 x0 !m0 = go collPos0 h0 k0 x0 m0
885+
insertKeyExists !collPos0 !h0 !k0 x0 m0 = go collPos0 h0 k0 x0 m0
886886
where
887887
go !_collPos !_shiftedHash !k x (Leaf h _kx)
888888
= Leaf h (L k x)
@@ -1169,7 +1169,7 @@ deleteFromSubtree h k _ t@(Collision hy v)
11691169
-- hash collision position if there was one. This information can be obtained
11701170
-- from 'lookupRecordCollision'. If there is no collision, pass (-1) as collPos.
11711171
deleteKeyExists :: Int -> Hash -> k -> HashMap k v -> HashMap k v
1172-
deleteKeyExists !collPos0 !h0 !k0 !m0 = go collPos0 h0 k0 m0
1172+
deleteKeyExists !collPos0 !h0 !k0 m0 = go collPos0 h0 k0 m0
11731173
where
11741174
go :: Int -> ShiftedHash -> k -> HashMap k v -> HashMap k v
11751175
go !_collPos !_shiftedHash !_k (Leaf _ _) = Empty

0 commit comments

Comments
 (0)