diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-20 10:43:54 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-21 18:42:50 +0100 |
commit | d8f1fa55af2d832c07d89abaf9ecffc44c6572f8 (patch) | |
tree | b5eca43019c12d9e1845c7ddaec65bc9d8289ff0 /src/dotty/tools/dotc/core/TypeOps.scala | |
parent | 2d3181ab808145fbdbe657740b41c16e82db7c87 (diff) | |
download | dotty-d8f1fa55af2d832c07d89abaf9ecffc44c6572f8.tar.gz dotty-d8f1fa55af2d832c07d89abaf9ecffc44c6572f8.tar.bz2 dotty-d8f1fa55af2d832c07d89abaf9ecffc44c6572f8.zip |
Performance tuning: Inline TypeAlias case for hot maps.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeOps.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala index afa39f2a3..272e93dd3 100644 --- a/src/dotty/tools/dotc/core/TypeOps.scala +++ b/src/dotty/tools/dotc/core/TypeOps.scala @@ -36,6 +36,8 @@ trait TypeOps { this: Context => asSeenFrom(tp.parent, pre, cls, theMap), tp.refinedName, asSeenFrom(tp.refinedInfo, pre, cls, theMap)) + case tp: TypeBounds if tp.lo eq tp.hi => + tp.derivedTypeAlias(asSeenFrom(tp.lo, pre, cls, theMap)) case _ => (if (theMap != null) theMap else new AsSeenFromMap(pre, cls)) .mapOver(tp) @@ -58,6 +60,8 @@ trait TypeOps { this: Context => tp case tp: RefinedType => tp.derivedRefinedType(simplify(tp.parent, theMap), tp.refinedName, simplify(tp.refinedInfo, theMap)) + case tp: TypeBounds if tp.lo eq tp.hi => + tp.derivedTypeAlias(simplify(tp.lo, theMap)) case AndType(l, r) => simplify(l, theMap) & simplify(r, theMap) case OrType(l, r) => |