KT-17110 Rewrite branches targeting other branches
- Rewrite branches targeting other branches to target directly the final destination to avoid runtime performance penalties. Fix of https://youtrack.jetbrains.com/issue/KT-17110
This commit is contained in:
committed by
Dmitry Petrov
parent
c9624ce0f9
commit
9fb0f59813
@@ -0,0 +1,21 @@
|
||||
fun test(x: Int, y: Int): String {
|
||||
var result: String
|
||||
if (x == 6) {
|
||||
if (y == 6) {
|
||||
result = "a"
|
||||
} else {
|
||||
result = "b"
|
||||
}
|
||||
} else {
|
||||
result = "c"
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (test(9, 10) != "c")
|
||||
return "Failures"
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// 2 GOTO L7
|
||||
Reference in New Issue
Block a user