Skip to content

Commit ae56c6e

Browse files
authored
Merge pull request #216 from sergv/master
Fix complexity of intersectionWith and intersectionWithKey
2 parents 5330c2e + 1958e41 commit ae56c6e

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
@@ -1582,7 +1582,7 @@ intersection a b = foldlWithKey' go empty a
15821582
_ -> m
15831583
{-# INLINABLE intersection #-}
15841584

1585-
-- | /O(n+m)/ Intersection of two maps. If a key occurs in both maps
1585+
-- | /O(n*log m)/ Intersection of two maps. If a key occurs in both maps
15861586
-- the provided function is used to combine the values from the two
15871587
-- maps.
15881588
intersectionWith :: (Eq k, Hashable k) => (v1 -> v2 -> v3) -> HashMap k v1
@@ -1594,7 +1594,7 @@ intersectionWith f a b = foldlWithKey' go empty a
15941594
_ -> m
15951595
{-# INLINABLE intersectionWith #-}
15961596

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

0 commit comments

Comments
 (0)