mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 00:21:26 +00:00
Ensure that no range instance is created for 'x in array.indices'
This commit is contained in:
9
compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt
vendored
Normal file
9
compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun testPrimitiveArray(i: Int, ints: IntArray) = i in ints.indices
|
||||
|
||||
fun testObjectArray(i: Int, xs: Array<Any>) = i in xs.indices
|
||||
|
||||
// 0 INVOKESTATIC kotlin/collections/ArraysKt.getIndices
|
||||
// 0 INVOKEVIRTUAL kotlin/ranges/IntRange.contains
|
||||
// 2 ARRAYLENGTH
|
||||
Reference in New Issue
Block a user