Make unsigned array constructor-like functions inline-only
This commit is contained in:
@@ -46,11 +46,12 @@ internal constructor(private val storage: ByteArray) : Collection<UByte> {
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UByteArray(size: Int, init: (Int) -> UByte): UByteArray {
|
||||
return UByteArray(ByteArray(size) { index -> init(index).toByte() })
|
||||
}
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
// TODO: @kotlin.internal.InlineOnly
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ubyteArrayOf(vararg elements: UByte): UByteArray = elements
|
||||
|
||||
@@ -46,11 +46,12 @@ internal constructor(private val storage: IntArray) : Collection<UInt> {
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UIntArray(size: Int, init: (Int) -> UInt): UIntArray {
|
||||
return UIntArray(IntArray(size) { index -> init(index).toInt() })
|
||||
}
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
// TODO: @kotlin.internal.InlineOnly
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun uintArrayOf(vararg elements: UInt): UIntArray = elements
|
||||
|
||||
@@ -46,11 +46,12 @@ internal constructor(private val storage: LongArray) : Collection<ULong> {
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ULongArray(size: Int, init: (Int) -> ULong): ULongArray {
|
||||
return ULongArray(LongArray(size) { index -> init(index).toLong() })
|
||||
}
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
// TODO: @kotlin.internal.InlineOnly
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ulongArrayOf(vararg elements: ULong): ULongArray = elements
|
||||
|
||||
@@ -46,11 +46,12 @@ internal constructor(private val storage: ShortArray) : Collection<UShort> {
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UShortArray(size: Int, init: (Int) -> UShort): UShortArray {
|
||||
return UShortArray(ShortArray(size) { index -> init(index).toShort() })
|
||||
}
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
// TODO: @kotlin.internal.InlineOnly
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ushortArrayOf(vararg elements: UShort): UShortArray = elements
|
||||
|
||||
Reference in New Issue
Block a user