Kotlin: Don't give stack traces for fake labels

There might be a significant performance hit for it.
This commit is contained in:
Ian Lynagh
2021-09-06 13:54:29 +01:00
parent 9bd0391c04
commit 774616450b

View File

@@ -263,9 +263,13 @@ fun doFile(invocationTrapFile: String, checkTrapIdentical: Boolean, logger: Logg
}
fun <T> fakeLabel(): Label<T> {
val sw = StringWriter()
Exception().printStackTrace(PrintWriter(sw))
println("Fake label from:\n$sw")
if (true) {
println("Fake label")
} else {
val sw = StringWriter()
Exception().printStackTrace(PrintWriter(sw))
println("Fake label from:\n$sw")
}
return Label(0)
}