Implement RandomAccess on NS(Mutable)Array bridges

This communicates to runtime tests that calls to `get` are O(1).
This commit is contained in:
Jake Wharton
2023-01-27 13:28:02 -05:00
committed by Sergey Bogolepov
parent d3fcd965ba
commit e821523b90
@@ -16,7 +16,7 @@ import kotlin.native.internal.ReportUnhandledException
@ExportTypeInfo("theObjCObjectWrapperTypeInfo")
internal interface ObjCObjectWrapper
internal class NSArrayAsKList : AbstractList<Any?>(), ObjCObjectWrapper {
internal class NSArrayAsKList : AbstractList<Any?>(), RandomAccess, ObjCObjectWrapper {
override val size: Int get() = getSize()
@@ -27,7 +27,7 @@ internal class NSArrayAsKList : AbstractList<Any?>(), ObjCObjectWrapper {
external override fun get(index: Int): Any?
}
internal class NSMutableArrayAsKMutableList : AbstractMutableList<Any?>(), ObjCObjectWrapper {
internal class NSMutableArrayAsKMutableList : AbstractMutableList<Any?>(), RandomAccess, ObjCObjectWrapper {
override val size: Int get() = getSize()