summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-09-14 17:50:39 +0000
committerPaul Phillips <paulp@improving.org>2011-09-14 17:50:39 +0000
commit17c04628617809b9542f7d3c9bcb8d3c6d23a2ec (patch)
treedd33f2880200b4b70ab697bab4021bf0ed456e20 /src/compiler
parent7cddbc6564521eb0affbd6ef0d8b5608e61e668f (diff)
downloadscala-17c04628617809b9542f7d3c9bcb8d3c6d23a2ec.tar.gz
scala-17c04628617809b9542f7d3c9bcb8d3c6d23a2ec.tar.bz2
scala-17c04628617809b9542f7d3c9bcb8d3c6d23a2ec.zip
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.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/reflect/internal/Types.scala4
1 files changed, 2 insertions, 2 deletions
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