Optimize iteration over CharSequence's on JVM
KT-7931 Optimize iteration over strings/charsequences on JVM
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// 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
|
||||
Reference in New Issue
Block a user