summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/mutable/OpenHashMap.scala
diff options
context:
space:
mode:
authorPap Lőrinc <paplorinc@gmail.com>2016-12-13 00:42:10 +0200
committerPap Lőrinc <paplorinc@gmail.com>2017-02-18 21:31:41 +0200
commit3ad5af7316fba587c43a2ddc070d556f261667a0 (patch)
tree7fe476e1f9b51552fa522867463f551ed79e048f /src/library/scala/collection/mutable/OpenHashMap.scala
parentdb8520e5c45d9ce24912849fad16a5c1b54a09b9 (diff)
downloadscala-3ad5af7316fba587c43a2ddc070d556f261667a0.tar.gz
scala-3ad5af7316fba587c43a2ddc070d556f261667a0.tar.bz2
scala-3ad5af7316fba587c43a2ddc070d556f261667a0.zip
Optimized HashTable.nextPositivePowerOfTwo
Diffstat (limited to 'src/library/scala/collection/mutable/OpenHashMap.scala')
-rw-r--r--src/library/scala/collection/mutable/OpenHashMap.scala4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/library/scala/collection/mutable/OpenHashMap.scala b/src/library/scala/collection/mutable/OpenHashMap.scala
index ca08f475ce..b2e9ee27b9 100644
--- a/src/library/scala/collection/mutable/OpenHashMap.scala
+++ b/src/library/scala/collection/mutable/OpenHashMap.scala
@@ -31,8 +31,6 @@ object OpenHashMap {
final private class OpenEntry[Key, Value](var key: Key,
var hash: Int,
var value: Option[Value])
-
- private[mutable] def nextPositivePowerOfTwo(i : Int) = 1 << (32 - Integer.numberOfLeadingZeros(i - 1))
}
/** A mutable hash map based on an open hashing scheme. The precise scheme is
@@ -67,7 +65,7 @@ extends AbstractMap[Key, Value]
override def empty: OpenHashMap[Key, Value] = OpenHashMap.empty[Key, Value]
- private[this] val actualInitialSize = OpenHashMap.nextPositivePowerOfTwo(initialSize)
+ private[this] val actualInitialSize = HashTable.nextPositivePowerOfTwo(initialSize)
private var mask = actualInitialSize - 1