Skip to content

Commit 9d436ea

Browse files
committed
Optimization: Specialize tpes
1 parent ae40761 commit 9d436ea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,10 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
978978
}
979979

980980
implicit class ListOfTreeDecorator(val xs: List[tpd.Tree]) extends AnyVal {
981-
def tpes: List[Type] = xs map (_.tpe)
981+
def tpes: List[Type] = xs match {
982+
case x :: xs1 => x.tpe :: xs1.tpes
983+
case nil => Nil
984+
}
982985
}
983986

984987
/** A trait for loaders that compute trees. Currently implemented just by DottyUnpickler. */

0 commit comments

Comments
 (0)