Implement fill extension function for UArrays (KT-28339)
This commit is contained in:
committed by
Ilya Gorbunov
parent
6b92190726
commit
876dff6d22
+8
@@ -2307,6 +2307,14 @@ public final class kotlin/collections/UArraysKt {
|
||||
public static final fun contentToString-GBYM_sE ([B)Ljava/lang/String;
|
||||
public static final fun contentToString-QwZRm1k ([J)Ljava/lang/String;
|
||||
public static final fun contentToString-rL5Bavg ([S)Ljava/lang/String;
|
||||
public static final fun fill-2fe2U9s ([IIII)V
|
||||
public static synthetic fun fill-2fe2U9s$default ([IIIIILjava/lang/Object;)V
|
||||
public static final fun fill-EtDCXyQ ([SSII)V
|
||||
public static synthetic fun fill-EtDCXyQ$default ([SSIIILjava/lang/Object;)V
|
||||
public static final fun fill-K6DWlUc ([JJII)V
|
||||
public static synthetic fun fill-K6DWlUc$default ([JJIIILjava/lang/Object;)V
|
||||
public static final fun fill-WpHrYlw ([BBII)V
|
||||
public static synthetic fun fill-WpHrYlw$default ([BBIIILjava/lang/Object;)V
|
||||
public static final fun plus-CFIt9YE ([ILjava/util/Collection;)[I
|
||||
public static final fun plus-kzHmqpY ([JLjava/util/Collection;)[J
|
||||
public static final fun plus-ojwP5H8 ([SLjava/util/Collection;)[S
|
||||
|
||||
@@ -1205,7 +1205,7 @@ object ArrayOps : TemplateGroupBase() {
|
||||
|
||||
val f_fill = fn("fill(element: T, fromIndex: Int = 0, toIndex: Int = size)") {
|
||||
platforms(Platform.JVM)
|
||||
include(InvariantArraysOfObjects, ArraysOfPrimitives)
|
||||
include(InvariantArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned)
|
||||
} builder {
|
||||
doc { "Fills original array with the provided value." }
|
||||
returns("Unit")
|
||||
@@ -1214,6 +1214,13 @@ object ArrayOps : TemplateGroupBase() {
|
||||
java.util.Arrays.fill(this, fromIndex, toIndex, element)
|
||||
"""
|
||||
}
|
||||
|
||||
specialFor(ArraysOfUnsigned) {
|
||||
val signedPrimitiveName = primitive!!.name.drop(1)
|
||||
body {
|
||||
"storage.fill(element.to$signedPrimitiveName(), fromIndex, toIndex)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val f_binarySearch = fn("binarySearch(element: T, fromIndex: Int = 0, toIndex: Int = size)") {
|
||||
|
||||
Reference in New Issue
Block a user