summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/collection/mutable/Map.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/scala/collection/mutable/Map.scala b/src/library/scala/collection/mutable/Map.scala
index 4c908aed92..d0d9867d1d 100644
--- a/src/library/scala/collection/mutable/Map.scala
+++ b/src/library/scala/collection/mutable/Map.scala
@@ -160,10 +160,10 @@ trait Map[A, B] extends AnyRef
def clear(): Unit = keys foreach -=
/** Check if this map maps <code>key</code> to a value.
- * Return that value if it exists, otherwise put <code>default</code>
- * as that key's value and return it.
- */
- def getOrElsePut(key: A, default: B): B =
+ * Return that value if it exists, otherwise put <code>default</code>
+ * as that key's value and return it.
+ */
+ def getOrElseUpdate(key: A, default: B): B =
get(key) match {
case Some(v) => v
case None => this(key) = default; default