Skip to content

Commit

Permalink
Merge pull request scala#5014 from janekdb/2.12.x-WeakHashSet-spelling
Browse files Browse the repository at this point in the history
Fix var spelling in WeakHashSet
  • Loading branch information
SethTisue committed Mar 14, 2016
2 parents ed6d4a5 + d0ca6ed commit 88b6918
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/reflect/scala/reflect/internal/util/WeakHashSet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 88b6918

Please sign in to comment.