mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
KT-12985 Do not create range instances for 'for' loop in CharSequence.indices
This commit is contained in:
15
compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCharSequenceIndices.kt
vendored
Normal file
15
compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCharSequenceIndices.kt
vendored
Normal 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
|
||||
Reference in New Issue
Block a user