From 5535e13b11839ed35e71ae7c6e589bc21f9eb595 Mon Sep 17 00:00:00 2001 From: Eugene Flesselle Date: Tue, 2 Jul 2024 10:40:07 +0200 Subject: [PATCH] Inline `Function1#andThen` in the interest of performance --- compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala index d3b231788287..98d9a0ca85f6 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala @@ -68,12 +68,12 @@ class TreeTypeMap( } } - val mapType: Type => Type = + def mapType(tp: Type): Type = val substMap = new TypeMap(): def apply(tp: Type): Type = tp match case tp: TermRef if tp.symbol.isImport => mapOver(tp) case tp => tp.substSym(substFrom, substTo) - typeMap.andThen(substMap).andThen(mapOwnerThis) + mapOwnerThis(substMap(typeMap(tp))) end mapType private def updateDecls(prevStats: List[Tree], newStats: List[Tree]): Unit =