Skip to content

Commit 1958e41

Browse files
committed
Fix complexity of intersectionWith and intersectionWithKey
1 parent efa43a2 commit 1958e41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Data/HashMap/Base.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ intersection a b = foldlWithKey' go empty a
15001500
_ -> m
15011501
{-# INLINABLE intersection #-}
15021502

1503-
-- | /O(n+m)/ Intersection of two maps. If a key occurs in both maps
1503+
-- | /O(n*log m)/ Intersection of two maps. If a key occurs in both maps
15041504
-- the provided function is used to combine the values from the two
15051505
-- maps.
15061506
intersectionWith :: (Eq k, Hashable k) => (v1 -> v2 -> v3) -> HashMap k v1
@@ -1512,7 +1512,7 @@ intersectionWith f a b = foldlWithKey' go empty a
15121512
_ -> m
15131513
{-# INLINABLE intersectionWith #-}
15141514

1515-
-- | /O(n+m)/ Intersection of two maps. If a key occurs in both maps
1515+
-- | /O(n*log m)/ Intersection of two maps. If a key occurs in both maps
15161516
-- the provided function is used to combine the values from the two
15171517
-- maps.
15181518
intersectionWithKey :: (Eq k, Hashable k) => (k -> v1 -> v2 -> v3)

0 commit comments

Comments
 (0)