aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Definitions.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-26 15:52:49 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-26 15:52:49 +0100
commitd93907e435461769b845781844e54a1a9b4a1995 (patch)
treee545a532709ea9eddc18359a96e68add13e404f7 /src/dotty/tools/dotc/core/Definitions.scala
parent32c041c8b40df3007783240493ed4c4708ec80db (diff)
downloaddotty-d93907e435461769b845781844e54a1a9b4a1995.tar.gz
dotty-d93907e435461769b845781844e54a1a9b4a1995.tar.bz2
dotty-d93907e435461769b845781844e54a1a9b4a1995.zip
Performance improvement: Avoid unncecessary allocations of ListBuffer
There were a lot in StoreReporter, as we are creating about 0.5M new ones per self-compile.
Diffstat (limited to 'src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r--src/dotty/tools/dotc/core/Definitions.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala
index 2b0180cf5..0ee0ea1e2 100644
--- a/src/dotty/tools/dotc/core/Definitions.scala
+++ b/src/dotty/tools/dotc/core/Definitions.scala
@@ -282,7 +282,7 @@ class Definitions {
object FunctionType {
def apply(args: List[Type], resultType: Type) =
- FunctionClass(args.length).typeRef.appliedTo(args :+ resultType)
+ FunctionClass(args.length).typeRef.appliedTo(args ::: resultType :: Nil)
def unapply(ft: Type): Option[(List[Type], Type)] = { // Dotty deviation: Type annotation needed because inferred type
// is Some[(List[Type], Type)] | None, which is not a legal unapply type.
val tsym = ft.typeSymbol