Simple version of redundant GOTO's removing
This commit is contained in:
committed by
Michael Bogdanov
parent
e1c2fbaec0
commit
da159c1e53
@@ -0,0 +1,12 @@
|
||||
|
||||
inline fun calc<T, R>(value : T, fn: (T)->R) : R = fn(value)
|
||||
inline fun identity<T>(value : T) : T = calc(value) {
|
||||
if (1 == 1) return it
|
||||
it
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val x = identity(1)
|
||||
}
|
||||
|
||||
// 1 GOTO
|
||||
Reference in New Issue
Block a user