From 17c04628617809b9542f7d3c9bcb8d3c6d23a2ec Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 14 Sep 2011 17:50:39 +0000 Subject: Create Type hashcodes at construction. This saves an unnecessary field (the lazy bitmap) and means hashing is faster. The hashCode is called on every created type anyway because of the lookup in unique, so this is pure gain. No review. --- src/compiler/scala/reflect/internal/Types.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala index fdfe37c96b..50ccf92d2f 100644 --- a/src/compiler/scala/reflect/internal/Types.scala +++ b/src/compiler/scala/reflect/internal/Types.scala @@ -1045,8 +1045,8 @@ trait Types extends api.Types { self: SymbolTable => // Subclasses ------------------------------------------------------------ - trait UniqueType { - override lazy val hashCode: Int = super.hashCode() + trait UniqueType extends Product { + final override val hashCode = scala.runtime.ScalaRunTime._hashCode(this) } /** A base class for types that defer some operations -- cgit v1.2.3