Skip to content

Commit 8c8d67b

Browse files
Fix outstanding test failure.
1 parent 4fe84ca commit 8c8d67b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/scala/scala/collection/decorators/MapDecorator.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ class MapDecorator[C, M <: IsMap[C]](coll: C)(implicit val map: M) {
5959
*/
6060
def mergeByKeyWith[W, X, That](other: Map[map.K, W])(f: PartialFunction[(Option[map.V], Option[W]), X])(implicit bf: BuildFrom[C, (map.K, X), That]): That = {
6161
val b = bf.newBuilder(coll)
62-
val traversed = mutable.Set.empty[W]
62+
val traversed = mutable.Set.empty[map.K]
6363
val pf = f.lift
6464
for {
6565
(k, v) <- map(coll)
66-
x <- pf(other.get(k).fold[(Option[map.V], Option[W])]((Some(v), None)){ w => traversed += w; (Some(v), Some(w)) })
66+
x <- pf(other.get(k).fold[(Option[map.V], Option[W])]((Some(v), None)){ w => traversed += k; (Some(v), Some(w)) })
6767
} {
6868
b += k -> x
6969
}
7070
for {
71-
(k, w) <- other if !traversed(w)
71+
(k, w) <- other if !traversed(k)
7272
x <- pf((None, Some(w)))
7373
} {
7474
b += k -> x

0 commit comments

Comments
 (0)