@@ -1791,48 +1791,62 @@ public actual inline fun <T> Array<T>.plusElement(element: T): Array<T> {
17911791
17921792/* *
17931793 * Sorts the array in-place.
1794+ *
1795+ * @sample samples.collections.Arrays.Sorting.sortArray
17941796 */
17951797public actual fun IntArray.sort (): Unit {
17961798 if (size > 1 ) java.util.Arrays .sort(this )
17971799}
17981800
17991801/* *
18001802 * Sorts the array in-place.
1803+ *
1804+ * @sample samples.collections.Arrays.Sorting.sortArray
18011805 */
18021806public actual fun LongArray.sort (): Unit {
18031807 if (size > 1 ) java.util.Arrays .sort(this )
18041808}
18051809
18061810/* *
18071811 * Sorts the array in-place.
1812+ *
1813+ * @sample samples.collections.Arrays.Sorting.sortArray
18081814 */
18091815public actual fun ByteArray.sort (): Unit {
18101816 if (size > 1 ) java.util.Arrays .sort(this )
18111817}
18121818
18131819/* *
18141820 * Sorts the array in-place.
1821+ *
1822+ * @sample samples.collections.Arrays.Sorting.sortArray
18151823 */
18161824public actual fun ShortArray.sort (): Unit {
18171825 if (size > 1 ) java.util.Arrays .sort(this )
18181826}
18191827
18201828/* *
18211829 * Sorts the array in-place.
1830+ *
1831+ * @sample samples.collections.Arrays.Sorting.sortArray
18221832 */
18231833public actual fun DoubleArray.sort (): Unit {
18241834 if (size > 1 ) java.util.Arrays .sort(this )
18251835}
18261836
18271837/* *
18281838 * Sorts the array in-place.
1839+ *
1840+ * @sample samples.collections.Arrays.Sorting.sortArray
18291841 */
18301842public actual fun FloatArray.sort (): Unit {
18311843 if (size > 1 ) java.util.Arrays .sort(this )
18321844}
18331845
18341846/* *
18351847 * Sorts the array in-place.
1848+ *
1849+ * @sample samples.collections.Arrays.Sorting.sortArray
18361850 */
18371851public actual fun CharArray.sort (): Unit {
18381852 if (size > 1 ) java.util.Arrays .sort(this )
@@ -1842,6 +1856,8 @@ public actual fun CharArray.sort(): Unit {
18421856 * Sorts the array in-place according to the natural order of its elements.
18431857 *
18441858 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
1859+ *
1860+ * @sample samples.collections.Arrays.Sorting.sortArrayOfComparable
18451861 */
18461862@kotlin.internal.InlineOnly
18471863public actual inline fun <T : Comparable <T >> Array <out T >.sort (): Unit {
@@ -1864,55 +1880,71 @@ public fun <T> Array<out T>.sort(): Unit {
18641880 * Sorts a range in the array in-place.
18651881 *
18661882 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
1883+ *
1884+ * @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
18671885 */
18681886public fun <T > Array <out T >.sort (fromIndex : Int = 0, toIndex : Int = size): Unit {
18691887 java.util.Arrays .sort(this , fromIndex, toIndex)
18701888}
18711889
18721890/* *
18731891 * Sorts a range in the array in-place.
1892+ *
1893+ * @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
18741894 */
18751895public fun ByteArray.sort (fromIndex : Int = 0, toIndex : Int = size): Unit {
18761896 java.util.Arrays .sort(this , fromIndex, toIndex)
18771897}
18781898
18791899/* *
18801900 * Sorts a range in the array in-place.
1901+ *
1902+ * @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
18811903 */
18821904public fun ShortArray.sort (fromIndex : Int = 0, toIndex : Int = size): Unit {
18831905 java.util.Arrays .sort(this , fromIndex, toIndex)
18841906}
18851907
18861908/* *
18871909 * Sorts a range in the array in-place.
1910+ *
1911+ * @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
18881912 */
18891913public fun IntArray.sort (fromIndex : Int = 0, toIndex : Int = size): Unit {
18901914 java.util.Arrays .sort(this , fromIndex, toIndex)
18911915}
18921916
18931917/* *
18941918 * Sorts a range in the array in-place.
1919+ *
1920+ * @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
18951921 */
18961922public fun LongArray.sort (fromIndex : Int = 0, toIndex : Int = size): Unit {
18971923 java.util.Arrays .sort(this , fromIndex, toIndex)
18981924}
18991925
19001926/* *
19011927 * Sorts a range in the array in-place.
1928+ *
1929+ * @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
19021930 */
19031931public fun FloatArray.sort (fromIndex : Int = 0, toIndex : Int = size): Unit {
19041932 java.util.Arrays .sort(this , fromIndex, toIndex)
19051933}
19061934
19071935/* *
19081936 * Sorts a range in the array in-place.
1937+ *
1938+ * @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
19091939 */
19101940public fun DoubleArray.sort (fromIndex : Int = 0, toIndex : Int = size): Unit {
19111941 java.util.Arrays .sort(this , fromIndex, toIndex)
19121942}
19131943
19141944/* *
19151945 * Sorts a range in the array in-place.
1946+ *
1947+ * @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
19161948 */
19171949public fun CharArray.sort (fromIndex : Int = 0, toIndex : Int = size): Unit {
19181950 java.util.Arrays .sort(this , fromIndex, toIndex)
0 commit comments