diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-26 15:52:49 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-26 15:52:49 +0100 |
commit | d93907e435461769b845781844e54a1a9b4a1995 (patch) | |
tree | e545a532709ea9eddc18359a96e68add13e404f7 /src/dotty/tools/dotc/core/Definitions.scala | |
parent | 32c041c8b40df3007783240493ed4c4708ec80db (diff) | |
download | dotty-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.scala | 2 |
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 |