Skip to content

Commit

Permalink
Map#foreach takes a Function of Tuple2 rather than a Function2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Ortiz committed Mar 22, 2010
1 parent 4bb4a35 commit fa309fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/scalaj/collection/j2s/MinimalTypes.scala
Expand Up @@ -69,7 +69,7 @@ private[collection] class RichMap[A, B](underlying: ju.Map[A, B]) {
case _ => coerce2(new MutableMapWrapper(underlying))
}

def foreach(f: (A, B) => Unit): Unit = {
def foreach(f: ((A, B)) => Unit): Unit = {
val g = (e: ju.Map.Entry[A, B]) => f(e.getKey, e.getValue)
Helpers.foreach(underlying.entrySet.iterator, g)
}
Expand All @@ -81,7 +81,7 @@ private[collection] class RichDictionary[A, B](underlying: ju.Dictionary[A, B])
case _ => coerce2(new DictionaryWrapper(underlying))
}

def foreach(f: (A, B) => Unit): Unit = {
def foreach(f: ((A, B)) => Unit): Unit = {
val g = (key: A) => f(key, underlying.get(key))
Helpers.foreach(underlying.keys, g)
}
Expand Down

0 comments on commit fa309fe

Please sign in to comment.