summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Tisue <seth@tisue.net>2016-03-14 17:31:48 -0400
committerSeth Tisue <seth@tisue.net>2016-03-14 17:31:48 -0400
commit88b691892300a93cc010c3c2a72f11e3feb5d940 (patch)
treee0d11eec18647476407749a351a59504aed5a1df
parented6d4a54df50caa1f79b7bff011bb2fd35d32a07 (diff)
parentd0ca6ed277f3d482a0032c312fe2b0d6a48fb6cc (diff)
downloadscala-88b691892300a93cc010c3c2a72f11e3feb5d940.tar.gz
scala-88b691892300a93cc010c3c2a72f11e3feb5d940.tar.bz2
scala-88b691892300a93cc010c3c2a72f11e3feb5d940.zip
Merge pull request #5014 from janekdb/2.12.x-WeakHashSet-spelling
Fix var spelling in WeakHashSet
-rw-r--r--src/reflect/scala/reflect/internal/util/WeakHashSet.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/reflect/scala/reflect/internal/util/WeakHashSet.scala b/src/reflect/scala/reflect/internal/util/WeakHashSet.scala
index f8dfa720d5..fffe4dd881 100644
--- a/src/reflect/scala/reflect/internal/util/WeakHashSet.scala
+++ b/src/reflect/scala/reflect/internal/util/WeakHashSet.scala
@@ -56,9 +56,9 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D
/**
* the limit at which we'll increase the size of the hash table
*/
- var threshhold = computeThreshHold
+ private[this] var threshold = computeThreshold
- private[this] def computeThreshHold: Int = (table.size * loadFactor).ceil.toInt
+ private[this] def computeThreshold: Int = (table.size * loadFactor).ceil.toInt
/**
* find the bucket associated with an element's hash code
@@ -121,7 +121,7 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D
private[this] def resize() {
val oldTable = table
table = new Array[Entry[A]](oldTable.size * 2)
- threshhold = computeThreshHold
+ threshold = computeThreshold
@tailrec
def tableLoop(oldBucket: Int): Unit = if (oldBucket < oldTable.size) {
@@ -176,7 +176,7 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D
def add() = {
table(bucket) = new Entry(elem, hash, oldHead, queue)
count += 1
- if (count > threshhold) resize()
+ if (count > threshold) resize()
elem
}
@@ -206,7 +206,7 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D
def add() {
table(bucket) = new Entry(elem, hash, oldHead, queue)
count += 1
- if (count > threshhold) resize()
+ if (count > threshold) resize()
}
@tailrec
@@ -252,7 +252,7 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D
// empty this set
override def clear(): Unit = {
table = new Array[Entry[A]](table.size)
- threshhold = computeThreshHold
+ threshold = computeThreshold
count = 0
// drain the queue - doesn't do anything because we're throwing away all the values anyway