diff options
Diffstat (limited to 'src')
5 files changed, 23 insertions, 5 deletions
diff --git a/src/dotnet-library/scala/collection/immutable/IntMap.scala b/src/dotnet-library/scala/collection/immutable/IntMap.scala deleted file mode 100644 index 11c32b6354..0000000000 --- a/src/dotnet-library/scala/collection/immutable/IntMap.scala +++ /dev/null @@ -1 +0,0 @@ -/* IntMap does not exist for the dotnet target */ diff --git a/src/dotnet-library/scala/collection/immutable/LongMap.scala b/src/dotnet-library/scala/collection/immutable/LongMap.scala deleted file mode 100644 index 07fab46388..0000000000 --- a/src/dotnet-library/scala/collection/immutable/LongMap.scala +++ /dev/null @@ -1 +0,0 @@ -/* LongMap does not exist for the dotnet target */ diff --git a/src/dotnet-library/scala/collection/immutable/TreeHashMap.scala b/src/dotnet-library/scala/collection/immutable/TreeHashMap.scala deleted file mode 100644 index 9590d02a32..0000000000 --- a/src/dotnet-library/scala/collection/immutable/TreeHashMap.scala +++ /dev/null @@ -1 +0,0 @@ -/* TreeHashMap does not exist for the dotnet target */ diff --git a/src/library/scala/collection/immutable/IntMap.scala b/src/library/scala/collection/immutable/IntMap.scala index 71b10610a3..0d54fcd671 100644 --- a/src/library/scala/collection/immutable/IntMap.scala +++ b/src/library/scala/collection/immutable/IntMap.scala @@ -7,7 +7,17 @@ private[immutable] object IntMapUtils{ def unsignedCompare(i : Int, j : Int) = (i < j) ^ (i < 0) ^ (j < 0) def shorter(m1 : Int, m2 : Int) = unsignedCompare(m2, m1) def complement(i : Int) = (-1) ^ i; - def branchMask(i : Int, j : Int) = java.lang.Integer.highestOneBit(i ^ j); + def highestOneBit(j : Int) = { + var i = j; + i |= (i >> 1); + i |= (i >> 2); + i |= (i >> 4); + i |= (i >> 8); + i |= (i >> 16); + i - (i >>> 1); + } + + def branchMask(i : Int, j : Int) = highestOneBit(i ^ j); def join[T](p1 : Int, t1 : IntMap[T], p2 : Int, t2 : IntMap[T]) : IntMap[T] = { val m = branchMask(p1, p2); diff --git a/src/library/scala/collection/immutable/LongMap.scala b/src/library/scala/collection/immutable/LongMap.scala index b23537aca6..953a89952e 100644 --- a/src/library/scala/collection/immutable/LongMap.scala +++ b/src/library/scala/collection/immutable/LongMap.scala @@ -7,7 +7,18 @@ private[immutable] object LongMapUtils{ def unsignedCompare(i : Long, j : Long) = (i < j) ^ (i < 0) ^ (j < 0) def shorter(m1 : Long, m2 : Long) = unsignedCompare(m2, m1) def complement(i : Long) = (-1) ^ i; - def branchMask(i : Long, j : Long) = java.lang.Long.highestOneBit(i ^ j); + def branchMask(i : Long, j : Long) = highestOneBit(i ^ j); + + def highestOneBit(j : Long) = { + var i = j; + i |= (i >> 1); + i |= (i >> 2); + i |= (i >> 4); + i |= (i >> 8); + i |= (i >> 16); + i |= (i >> 32); + i - (i >>> 1); + } def join[T](p1 : Long, t1 : LongMap[T], p2 : Long, t2 : LongMap[T]) : LongMap[T] = { val m = branchMask(p1, p2); |