diff options
Diffstat (limited to 'src/library/scala/collection/immutable/ListMap.scala')
-rw-r--r-- | src/library/scala/collection/immutable/ListMap.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library/scala/collection/immutable/ListMap.scala b/src/library/scala/collection/immutable/ListMap.scala index 5fced699f3..9ce5410546 100644 --- a/src/library/scala/collection/immutable/ListMap.scala +++ b/src/library/scala/collection/immutable/ListMap.scala @@ -23,7 +23,9 @@ object ListMap extends ImmutableMapFactory[ListMap] { /** $mapCanBuildFromInfo */ implicit def canBuildFrom[A, B]: CanBuildFrom[Coll, (A, B), ListMap[A, B]] = new MapCanBuildFrom[A, B] - def empty[A, B]: ListMap[A, B] = new ListMap + def empty[A, B]: ListMap[A, B] = EmptyListMap.asInstanceOf[ListMap[A, B]] + + private object EmptyListMap extends ListMap[Any, Nothing] { } } /** This class implements immutable maps using a list-based data structure. |