diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2015-10-25 23:20:04 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-12-18 10:31:49 +0100 |
commit | 92affd3e76d1a3019f1c35ac20af32360d914641 (patch) | |
tree | 296270bf7271c1085a94d71e2d4bfa5789b3bfca /src/library/scala/collection/immutable/ListMap.scala | |
parent | 1873db3fb78ba777c009bce11564466de875257a (diff) | |
download | scala-92affd3e76d1a3019f1c35ac20af32360d914641.tar.gz scala-92affd3e76d1a3019f1c35ac20af32360d914641.tar.bz2 scala-92affd3e76d1a3019f1c35ac20af32360d914641.zip |
Remove unused imports and other minor cleanups
- Language imports are preceding other imports
- Deleted empty file: InlineErasure
- Removed some unused private[parallel] methods in
scala/collection/parallel/package.scala
This removes hundreds of warnings when compiling with
"-Xlint -Ywarn-dead-code -Ywarn-unused -Ywarn-unused-import".
Diffstat (limited to 'src/library/scala/collection/immutable/ListMap.scala')
-rw-r--r-- | src/library/scala/collection/immutable/ListMap.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/library/scala/collection/immutable/ListMap.scala b/src/library/scala/collection/immutable/ListMap.scala index c59f4f7436..f30c0cbf8e 100644 --- a/src/library/scala/collection/immutable/ListMap.scala +++ b/src/library/scala/collection/immutable/ListMap.scala @@ -13,7 +13,7 @@ package collection package immutable import generic._ -import scala.annotation.{tailrec, bridge} +import scala.annotation.tailrec /** $factoryInfo * @since 1 @@ -30,7 +30,7 @@ object ListMap extends ImmutableMapFactory[ListMap] { def empty[A, B]: ListMap[A, B] = EmptyListMap.asInstanceOf[ListMap[A, B]] @SerialVersionUID(-8256686706655863282L) - private object EmptyListMap extends ListMap[Any, Nothing] { + private object EmptyListMap extends ListMap[Any, Nothing] { override def apply(key: Any) = throw new NoSuchElementException("key not found: " + key) override def contains(key: Any) = false } @@ -179,16 +179,16 @@ extends AbstractMap[A, B] @tailrec private def get0(cur: ListMap[A, B1], k: A): Option[B1] = if (k == cur.key) Some(cur.value) else if (cur.next.nonEmpty) get0(cur.next, k) else None - - + + override def contains(key: A): Boolean = contains0(this, key) - + @tailrec private def contains0(cur: ListMap[A, B1], k: A): Boolean = if (k == cur.key) true else if (cur.next.nonEmpty) contains0(cur.next, k) else false - + /** This method allows one to create a new map with an additional mapping * from `key` to `value`. If the map contains already a mapping for `key`, * it will be overridden by this function. @@ -198,7 +198,7 @@ extends AbstractMap[A, B] new m.Node[B2](k, v) } - + /** Creates a new mapping without the given `key`. * If the map does not contain a mapping for the given key, the * method returns the same map. |