summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/mutable/HashTable.scala
diff options
context:
space:
mode:
authorDavid Hall <dlwh@berkeley.edu>2012-03-30 18:26:46 -0700
committerDavid Hall <dlwh@berkeley.edu>2012-03-30 18:26:46 -0700
commit88bc33301a1d1994a7a60f91ff7603c8e902b6a8 (patch)
tree1ef95863a0d8ad82e1d30e5b76503bd4e59c8c84 /src/library/scala/collection/mutable/HashTable.scala
parentdc8b431f1c38ff805d660c44b19ee5ecc91bddb2 (diff)
downloadscala-88bc33301a1d1994a7a60f91ff7603c8e902b6a8.tar.gz
scala-88bc33301a1d1994a7a60f91ff7603c8e902b6a8.tar.bz2
scala-88bc33301a1d1994a7a60f91ff7603c8e902b6a8.zip
Fixes SI-5632 (serialization of large HashTables)
Converts HashTable threshold to long before multiplying by a large value. Test is very slow and requires giving partest more RAM. Rather than committing it, I'm attaching it as a gist. Whoever does the merge is more than welcome to commit it along with this patch… Test: https://gist.github.com/2257703
Diffstat (limited to 'src/library/scala/collection/mutable/HashTable.scala')
-rw-r--r--src/library/scala/collection/mutable/HashTable.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/collection/mutable/HashTable.scala b/src/library/scala/collection/mutable/HashTable.scala
index cc0aed6963..06b7d40bfc 100644
--- a/src/library/scala/collection/mutable/HashTable.scala
+++ b/src/library/scala/collection/mutable/HashTable.scala
@@ -366,7 +366,7 @@ private[collection] object HashTable {
private[collection] final def newThreshold(_loadFactor: Int, size: Int) = ((size.toLong * _loadFactor) / loadFactorDenum).toInt
- private[collection] final def sizeForThreshold(_loadFactor: Int, thr: Int) = thr * loadFactorDenum / _loadFactor
+ private[collection] final def sizeForThreshold(_loadFactor: Int, thr: Int) = ((thr.toLong * loadFactorDenum) / _loadFactor).toInt
private[collection] final def capacity(expectedSize: Int) = if (expectedSize == 0) 1 else powerOfTwo(expectedSize)