summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2005-10-03 21:39:38 +0000
committermihaylov <mihaylov@epfl.ch>2005-10-03 21:39:38 +0000
commit0c5513d5fc3092f650627c0d51b63ec087795944 (patch)
treea764034780c2bfac8959f65c6867b98cf867f379
parentce5f59f920161c6d1e4148f58d813e667ffd9862 (diff)
downloadscala-0c5513d5fc3092f650627c0d51b63ec087795944.tar.gz
scala-0c5513d5fc3092f650627c0d51b63ec087795944.tar.bz2
scala-0c5513d5fc3092f650627c0d51b63ec087795944.zip
Made platform-independant
-rw-r--r--sources/scala/collection/immutable/Tree.scala9
-rw-r--r--sources/scala/util/automata/SubsetConstruction.scala2
2 files changed, 4 insertions, 7 deletions
diff --git a/sources/scala/collection/immutable/Tree.scala b/sources/scala/collection/immutable/Tree.scala
index aeb21a29f9..fdb3f8cf46 100644
--- a/sources/scala/collection/immutable/Tree.scala
+++ b/sources/scala/collection/immutable/Tree.scala
@@ -1,6 +1,6 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2005, LAMP/EPFL **
+** / __/ __// _ | / / / _ | (c) 2003-2004, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
@@ -38,8 +38,6 @@
package scala.collection.immutable;
-import java.lang.Math;
-
/** General Balanced Trees - highly efficient functional dictionaries.
*
* An efficient implementation of Prof. Arne Andersson's General
@@ -212,7 +210,7 @@ private case class INode[A <% Ordered[A],B](t1: GBTree[A,B],
balance_p(GBNode(key, value, smaller, t1),smaller);
protected def balance_p(t:GBTree[A,B],subtree:GBTree[A,B]):InsertTree[A,B] = {
val Pair(subHeight, subSize) = subtree.count;
- val totalHeight = 2 * Math.max(height, subHeight);
+ val totalHeight = 2 * scala.runtime.compat.Math.max(height, subHeight);
val totalSize = size + subSize + 1;
val BalanceHeight = totalSize * totalSize;
if(totalHeight > BalanceHeight) ITree(t.balance(totalSize));
@@ -280,7 +278,7 @@ private case class GBNode[A <% Ordered[A],B](key: A,
if (mySize == 1)
Pair(1, mySize)
else
- Pair(2 * Math.max(sHeight, bHeight), mySize);
+ Pair(2 * scala.runtime.compat.Math.max(sHeight, bHeight), mySize);
}
def isDefinedAt(sKey:A):Boolean = {
@@ -374,4 +372,3 @@ private case class GBNode[A <% Ordered[A],B](key: A,
override def hashCode() =
value.hashCode() + smaller.hashCode() + bigger.hashCode();
}
-
diff --git a/sources/scala/util/automata/SubsetConstruction.scala b/sources/scala/util/automata/SubsetConstruction.scala
index c00c73a422..ddf122dbe3 100644
--- a/sources/scala/util/automata/SubsetConstruction.scala
+++ b/sources/scala/util/automata/SubsetConstruction.scala
@@ -27,7 +27,7 @@ class SubsetConstruction[T <: AnyRef](val nfa: NondetWordAutom[T]) {
def selectTag(Q:BitSet, finals:Array[Int]) = {
val it = Q.toSet(true).elements;
- var mintag = java.lang.Integer.MAX_VALUE;
+ var mintag = scala.runtime.compat.Math.MAX_INT;
while(it.hasNext) {
val tag = finals(it.next);
if((0 < tag) && (tag < mintag))