Fixing IntMap/LongMap.getOrElse.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@16379 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
DRMacIver 2008-10-27 16:35:42 +00:00
parent c4b7e55cf5
commit 2e260d982e
2 changed files with 2 additions and 2 deletions

View File

@ -225,7 +225,7 @@ sealed abstract class IntMap[+T] extends scala.collection.immutable.Map[Int, T]{
final override def getOrElse[S >: T](key : Int, default : =>S) : S = this match {
case IntMap.Nil => default;
case IntMap.Tip(key2, value) => if (key == key2) value else default;
case IntMap.Bin(prefix, mask, left, right) => if (zero(key, mask)) left(key) else right(key);
case IntMap.Bin(prefix, mask, left, right) => if (zero(key, mask)) left.getOrElse(key, default) else right.getOrElse(key, default);
}
final override def apply(key : Int) : T = this match {

View File

@ -226,7 +226,7 @@ sealed abstract class LongMap[+T] extends scala.collection.immutable.Map[Long, T
final override def getOrElse[S >: T](key : Long, default : =>S) : S = this match {
case LongMap.Nil => default;
case LongMap.Tip(key2, value) => if (key == key2) value else default;
case LongMap.Bin(prefix, mask, left, right) => if (zero(key, mask)) left(key) else right(key);
case LongMap.Bin(prefix, mask, left, right) => if (zero(key, mask)) left.getOrElse(key, default) else right.getOrElse(key, default);
}
final override def apply(key : Long) : T = this match {