summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/collection/mutable/MultiMap.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library/scala/collection/mutable/MultiMap.scala b/src/library/scala/collection/mutable/MultiMap.scala
index 8279bd53f8..e335500349 100644
--- a/src/library/scala/collection/mutable/MultiMap.scala
+++ b/src/library/scala/collection/mutable/MultiMap.scala
@@ -40,7 +40,9 @@ trait MultiMap[A, B] extends Map[A, Set[B]] {
def removeBinding(key: A, value: B): this.type = {
get(key) match {
case None =>
- case Some(set) => set -= value
+ case Some(set) =>
+ set -= value
+ if (set.isEmpty) this -= key
}
this
}