Skip to content

Commit 85a9257

Browse files
committed
Eliminate a hot closure in ConstFold by inlining
1 parent e67ac03 commit 85a9257

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/ConstFold.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ object ConstFold {
4848
}
4949
}
5050

51-
private def finish[T <: Tree](tree: T)(compX: => Constant)(implicit ctx: Context): T =
51+
@forceInline private def finish[T <: Tree](tree: T)(compX: => Constant)(implicit ctx: Context): T =
5252
try {
5353
val x = compX
5454
if (x ne null) tree.withType(ConstantType(x)).asInstanceOf[T]

0 commit comments

Comments
 (0)