Skip to content

Commit 0e0b74d

Browse files
committed
two: Force the fresh Leaf
Just to be safe.
1 parent 189b261 commit 0e0b74d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Data/HashMap/Internal.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,8 @@ unsafeInsert k0 v0 m0 = runST (go h0 k0 v0 0 m0)
948948
-- It is the caller's responsibility to ensure that the HashMap argument is in
949949
-- WHNF.
950950
two :: Shift -> Hash -> k -> v -> Hash -> HashMap k v -> ST s (HashMap k v)
951-
two s h1 k1 v1 = two' s h1 (Leaf h1 (L k1 v1))
951+
two s h1 k1 v1 = two' s h1 l
952+
where !l = Leaf h1 (L k1 v1)
952953
{-# INLINE two #-}
953954

954955
-- | Create a map from two 'Leaf' or 'Collision' nodes whose hashes are

0 commit comments

Comments
 (0)