Use emptyArray in orEmpty.
This commit is contained in:
@@ -24,7 +24,7 @@ import java.nio.charset.Charset
|
||||
|
||||
|
||||
/** Returns the array if it's not `null`, or an empty array otherwise. */
|
||||
public inline fun <reified T> Array<out T>?.orEmpty(): Array<out T> = this ?: arrayOf<T>()
|
||||
public inline fun <reified T> Array<out T>?.orEmpty(): Array<out T> = this ?: emptyArray<T>()
|
||||
|
||||
/**
|
||||
* Converts the contents of this byte array to a string using the specified [charset].
|
||||
|
||||
Reference in New Issue
Block a user