diff options
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/util/HashSet.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/util/HashSet.scala b/src/dotty/tools/dotc/util/HashSet.scala index 32c3dbc3d..44646e2ba 100644 --- a/src/dotty/tools/dotc/util/HashSet.scala +++ b/src/dotty/tools/dotc/util/HashSet.scala @@ -30,7 +30,7 @@ class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) exte var h = index(hash(x)) var entry = table(h) while (entry ne null) { - if (x == entry) + if (x equals entry) return entry.asInstanceOf[T] h = index(h + 1) @@ -49,7 +49,7 @@ class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) exte def findEntry(x: T): T = { var h = index(hash(x)) var entry = table(h) - while ((entry ne null) && x != entry) { + while ((entry ne null) && !(x equals entry)) { h = index(h + 1) entry = table(h) } @@ -79,7 +79,7 @@ class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) exte var h = index(hash(x)) var entry = table(h) while (entry ne null) { - if (x == entry) return + if (x equals entry) return h = index(h + 1) entry = table(h) } |