Files
kotlin/compiler/testData/codegen/bytecodeText/forLoop/forInCharSequence.kt
Dmitry Petrov 1ee337d976 Optimize iteration over CharSequence's on JVM
KT-7931 Optimize iteration over strings/charsequences on JVM
2017-04-25 10:07:05 +03:00

19 lines
292 B
Kotlin
Vendored

// WITH_RUNTIME
fun test() {
var s = ""
for (c in "testString") {
s += c
}
for (c in StringBuilder("testStringBuilder")) {
s += c
}
for (c in "testCharSequence".apply<CharSequence>{}) {
s += c
}
}
// 0 iterator
// 0 hasNext
// 0 nextChar