diff options
author | Paul Phillips <paulp@improving.org> | 2011-12-29 16:53:10 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-12-30 07:43:47 -0800 |
commit | bfa49b0d545b087c578ebebc0c89bb1180fa9d85 (patch) | |
tree | 8062ca1f27c4526bc9a43bfebb52b24b1ba4f92a /src/compiler/scala/reflect/internal/Types.scala | |
parent | 0947d08eef6397efe6dd97c41cf480ff13762591 (diff) | |
download | scala-bfa49b0d545b087c578ebebc0c89bb1180fa9d85.tar.gz scala-bfa49b0d545b087c578ebebc0c89bb1180fa9d85.tar.bz2 scala-bfa49b0d545b087c578ebebc0c89bb1180fa9d85.zip |
Optimizations in typeref creation.
A couple locations where more work than necessary is performed
when created a typeref. (Not to mention creating bogus typerefs
applying arguments to implementation classes.)
Diffstat (limited to 'src/compiler/scala/reflect/internal/Types.scala')
-rw-r--r-- | src/compiler/scala/reflect/internal/Types.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala index 38f51b1459..f37509af39 100644 --- a/src/compiler/scala/reflect/internal/Types.scala +++ b/src/compiler/scala/reflect/internal/Types.scala @@ -1900,7 +1900,7 @@ A type's typeSymbol should never be inspected directly. // note: does not go through typeRef. There's no need to because // neither `pre` nor `sym` changes. And there's a performance // advantage to call TypeRef directly. - override def typeConstructor = TypeRef(pre, sym, Nil) + override def typeConstructor = if (args.isEmpty) this else TypeRef(pre, sym, Nil) // A reference (in a Scala program) to a type that has type // parameters, but where the reference does not include type |