mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Avoid using a separate origin for temporary variables introduced for for loops. That doesn't add anything and gives one more case for optimizations to deal with. Extend the JVM specific optimizations to remove temporary variables to deal with more cases encountered in for loops lowering.
14 lines
181 B
Kotlin
Vendored
14 lines
181 B
Kotlin
Vendored
fun test() {
|
|
var s = ""
|
|
for (c in "testString") {
|
|
s += c
|
|
}
|
|
}
|
|
|
|
// 0 iterator
|
|
// 0 hasNext
|
|
// 0 nextChar
|
|
// 0 INVOKEINTERFACE
|
|
// 1 charAt \(I\)C
|
|
// 1 length \(\)I
|