From b86d29eda5166c6e8033215a1615fdab33a5de40 Mon Sep 17 00:00:00 2001 From: Lex Spoon Date: Wed, 26 Jun 2013 18:01:00 -0400 Subject: Adds equals and hashCode to three classes that implement Ordered. --- src/reflect/scala/reflect/internal/util/Statistics.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/reflect') diff --git a/src/reflect/scala/reflect/internal/util/Statistics.scala b/src/reflect/scala/reflect/internal/util/Statistics.scala index b583137059..905f1bf26e 100644 --- a/src/reflect/scala/reflect/internal/util/Statistics.scala +++ b/src/reflect/scala/reflect/internal/util/Statistics.scala @@ -133,6 +133,12 @@ quant) if (this.value < that.value) -1 else if (this.value > that.value) 1 else 0 + override def equals(that: Any): Boolean = + that match { + case that: Counter => (this compare that) == 0 + case _ => false + } + override def hashCode = value override def toString = value.toString } @@ -184,6 +190,12 @@ quant) if (this.specificNanos < that.specificNanos) -1 else if (this.specificNanos > that.specificNanos) 1 else 0 + override def equals(that: Any): Boolean = + that match { + case that: StackableTimer => (this compare that) == 0 + case _ => false + } + override def hashCode = specificNanos.## override def toString = s"${super.toString} aggregate, ${show(specificNanos)} specific" } -- cgit v1.2.3