aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/util/LRUCache.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/util/LRUCache.scala b/src/dotty/tools/dotc/util/LRUCache.scala
index 4d0d82c99..5f53e81c4 100644
--- a/src/dotty/tools/dotc/util/LRUCache.scala
+++ b/src/dotty/tools/dotc/util/LRUCache.scala
@@ -15,7 +15,7 @@ import annotation.tailrec
* get promoted to be first in the queue. Elements are evicted
* at the `last` position.
*/
-class LRUCache[Key >: Null : ClassTag, Value >: Null: ClassTag] {
+class LRUCache[Key >: Null <: AnyRef : ClassTag, Value >: Null: ClassTag] {
import LRUCache._
val keys = new Array[Key](Retained)
val values = new Array[Value](Retained)
@@ -33,7 +33,7 @@ class LRUCache[Key >: Null : ClassTag, Value >: Null: ClassTag] {
@tailrec
def lookupNext(prev: Int, current: Int, nx: SixteenNibbles): Value = {
val follow = nx(current)
- if (keys(current) == key) {
+ if (keys(current) eq key) {
// arrange so that found element is at position `first`.
if (current == last) last = prev
else if (prev != last) {