[stdlib] Explicit visibility and return types: Collections

This commit is contained in:
Ilya Gorbunov
2023-11-12 02:02:06 +01:00
committed by Space Team
parent 0dd61c9f81
commit aa4419b7e3
23 changed files with 124 additions and 83 deletions
@@ -25,7 +25,7 @@ public actual inline fun <reified T> Array<out T>?.orEmpty(): Array<out T> = thi
public inline fun ByteArray.toString(charset: Charset): String = String(this, charset)
/**
* Returns a *typed* array containing all of the elements of this collection.
* Returns a *typed* array containing all the elements of this collection.
*
* Allocates an array of runtime type `T` having its size equal to the size of this collection
* and populates the array with the elements of this collection.
@@ -63,7 +63,7 @@ public inline fun <T> java.util.Enumeration<T>.toList(): List<T> = java.util.Col
/**
* Returns a new list with the elements of this list randomly shuffled.
* Returns a new list with the elements of this collection randomly shuffled.
*/
@SinceKotlin("1.2")
public actual fun <T> Iterable<T>.shuffled(): List<T> = toMutableList().apply { shuffle() }
@@ -7,6 +7,9 @@
package kotlin.collections
/**
* Marker interface indicating that the [List] implementation supports fast indexed access.
*/
@SinceKotlin("1.1") public actual typealias RandomAccess = java.util.RandomAccess