Skip to content

Commit

Permalink
Inline Function1#andThen in the interest of performance
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneFlesselle committed Jul 2, 2024
1 parent c4e703f commit 5535e13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 5535e13

Please sign in to comment.