diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-11 14:56:31 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-11 14:56:31 +0000 |
commit | 4cfcc156f404f574451d2ddcaf62326d32d0ef95 (patch) | |
tree | f67794076dadc56ae13ecb8ba9458e72b1f07cee /src | |
parent | ec233d3dbf784e62fdcf27b159689acd94bdaaab (diff) | |
download | scala-4cfcc156f404f574451d2ddcaf62326d32d0ef95.tar.gz scala-4cfcc156f404f574451d2ddcaf62326d32d0ef95.tar.bz2 scala-4cfcc156f404f574451d2ddcaf62326d32d0ef95.zip |
Eliminated the 10 unchecked warnings emanating ...
Eliminated the 10 unchecked warnings emanating from RedBlack.scala. No
review.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/collection/immutable/RedBlack.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/library/scala/collection/immutable/RedBlack.scala b/src/library/scala/collection/immutable/RedBlack.scala index 3c09db7407..1c2d4ba362 100644 --- a/src/library/scala/collection/immutable/RedBlack.scala +++ b/src/library/scala/collection/immutable/RedBlack.scala @@ -199,8 +199,8 @@ abstract class RedBlack[A] extends Serializable { def unzip(zipper: List[NonEmpty[B]], leftMost: Boolean): List[NonEmpty[B]] = { val next = if (leftMost) zipper.head.left else zipper.head.right next match { - case node: NonEmpty[B] => unzip(node :: zipper, leftMost) - case Empty => zipper + case node: NonEmpty[_] => unzip(node :: zipper, leftMost) + case Empty => zipper } } @@ -211,20 +211,20 @@ abstract class RedBlack[A] extends Serializable { leftZipper: List[NonEmpty[B]], rightZipper: List[NonEmpty[B]], smallerDepth: Int): (List[NonEmpty[B]], Boolean, Boolean, Int) = (left, right) match { - case (l: BlackTree[B], r: BlackTree[B]) => + case (l @ BlackTree(_, _, _, _), r @ BlackTree(_, _, _, _)) => unzipBoth(l.right, r.left, l :: leftZipper, r :: rightZipper, smallerDepth + 1) - case (l: RedTree[B], r: RedTree[B]) => + case (l @ RedTree(_, _, _, _), r @ RedTree(_, _, _, _)) => unzipBoth(l.right, r.left, l :: leftZipper, r :: rightZipper, smallerDepth) - case (_, r: RedTree[B]) => + case (_, r @ RedTree(_, _, _, _)) => unzipBoth(left, r.left, leftZipper, r :: rightZipper, smallerDepth) - case (l: RedTree[B], _) => + case (l @ RedTree(_, _, _, _), _) => unzipBoth(l.right, right, l :: leftZipper, rightZipper, smallerDepth) case (Empty, Empty) => (Nil, true, false, smallerDepth) - case (Empty, r: BlackTree[B]) => + case (Empty, r @ BlackTree(_, _, _, _)) => val leftMost = true (unzip(r :: rightZipper, leftMost), false, leftMost, smallerDepth) - case (l: BlackTree[B], Empty) => + case (l @ BlackTree(_, _, _, _), Empty) => val leftMost = false (unzip(l :: leftZipper, leftMost), false, leftMost, smallerDepth) } @@ -234,7 +234,7 @@ abstract class RedBlack[A] extends Serializable { private[this] def rebalance(newLeft: Tree[B], newRight: Tree[B]) = { // This is like drop(n-1), but only counting black nodes def findDepth(zipper: List[NonEmpty[B]], depth: Int): List[NonEmpty[B]] = zipper match { - case (_: BlackTree[B]) :: tail => + case BlackTree(_, _, _, _) :: tail => if (depth == 1) zipper else findDepth(tail, depth - 1) case _ :: tail => findDepth(tail, depth) case Nil => system.error("Defect: unexpected empty zipper while computing range") |