diff --git a/runtime/src/main/kotlin/generated/_ArraysNative.kt b/runtime/src/main/kotlin/generated/_ArraysNative.kt index b1665b398be..c1be4dee4ef 100644 --- a/runtime/src/main/kotlin/generated/_ArraysNative.kt +++ b/runtime/src/main/kotlin/generated/_ArraysNative.kt @@ -1404,6 +1404,15 @@ public actual fun Array.sortWith(comparator: Comparator): Unit if (size > 1) sortArrayWith(this, 0, size, comparator) } +/** + * Sorts a range in the array in-place with the given [comparator]. + * + * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + */ +public fun Array.sortWith(comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size): Unit { + sortArrayWith(this, fromIndex, toIndex, comparator) +} + /** * Returns a *typed* object array containing all of the elements of this primitive array. */ diff --git a/runtime/src/main/kotlin/kotlin/collections/Arrays.kt b/runtime/src/main/kotlin/kotlin/collections/Arrays.kt index 25871476ff6..500d0369264 100644 --- a/runtime/src/main/kotlin/kotlin/collections/Arrays.kt +++ b/runtime/src/main/kotlin/kotlin/collections/Arrays.kt @@ -19,16 +19,6 @@ public actual inline fun Array?.orEmpty(): Array = thi throw IllegalArgumentException("fromIndex ($fromIndex) is greater than toIndex ($toIndex).") } -// TODO: Move to generated code -/** - * Sorts a range in the array in-place with the given [comparator]. - * - * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. - */ -public fun Array.sortWith(comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size): Unit { - sortArrayWith(this, fromIndex, toIndex, comparator) -} - // TODO: internal /**