File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -956,18 +956,20 @@ unsafeInsert k0 v0 m0 = runST (go h0 k0 v0 0 m0)
956956 | otherwise = go h k x s $ BitmapIndexed (mask hy s) (A. singleton t)
957957{-# INLINABLE unsafeInsert #-}
958958
959- -- | Create a map from two key-value pairs which hashes don't collide. To
960- -- enhance sharing, the second key-value pair is represented by the hash of its
961- -- key and a singleton HashMap pairing its key with its value.
962- --
963- -- Note: to avoid silly thunks, this function must be strict in the
964- -- key. See issue #232. We don't need to force the HashMap argument
965- -- because it's already in WHNF (having just been matched) and we
966- -- just put it directly in an array.
959+ -- | Create a map from a key-value pair and a 'Leaf' or 'Collision' node with a
960+ -- different hash.
961+ --
962+ -- It is the caller's responsibility to ensure that the HashMap argument is in
963+ -- WHNF.
967964two :: Shift -> Hash -> k -> v -> Hash -> HashMap k v -> ST s (HashMap k v )
968965two s h1 k1 v1 = two' s h1 (Leaf h1 (L k1 v1))
969966{-# INLINE two #-}
970967
968+ -- | Create a map from two 'Leaf' or 'Collision' nodes whose hashes are
969+ -- distinct.
970+ --
971+ -- It is the caller's responsibility to ensure that both HashMap arguments are
972+ -- in WHNF.
971973two' :: Shift -> Hash -> HashMap k v -> Hash -> HashMap k v -> ST s (HashMap k v )
972974two' s h1 lc1 h2 lc2 = go (shiftHash h1 s) lc1 (shiftHash h2 s) lc2
973975 where
You can’t perform that action at this time.
0 commit comments