KT-12985 Do not create range instances for 'for' loop in CharSequence.indices

This commit is contained in:
Dmitry Petrov
2016-07-05 16:06:18 +03:00
parent 3dc23a0e02
commit 3445fe0d30
6 changed files with 71 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
// WITH_RUNTIME
fun test(s: CharSequence): Int {
var result = 0
for (i in s.indices) {
result = result * 10 + (i + 1)
}
return result
}
// 0 iterator
// 0 getStart
// 0 getEnd
// 0 getFirst
// 0 getLast