Provide a way to construct an empty typed array without init lambda.
This commit is contained in:
@@ -13,3 +13,7 @@ public inline fun <reified T> Array(size: Int, init: (Int) -> T): Array<T> {
|
||||
|
||||
return result as Array<T>
|
||||
}
|
||||
|
||||
// Returns an empty array of the specified type `T`.
|
||||
public inline fun <reified T> emptyArray(): Array<T> = arrayOfNulls<T>(0) as Array<T>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user