fixed up arrays.orEmpty() API - thanks again Stepan!

This commit is contained in:
James Strachan
2012-03-08 14:51:09 +00:00
parent db72208a91
commit 34a0d266d0
+1 -1
View File
@@ -108,5 +108,5 @@ inline fun <T> Array<T>.notEmpty() : Boolean = !this.isEmpty()
inline fun <T> Array<T>.isEmpty() : Boolean = this.size == 0
/** Returns the array if its not null or else returns an empty array */
inline fun <T> Array<T?>?.orEmpty() : Array<T?> = if (this != null) this else array<T?>()
inline fun <T> Array<T>?.orEmpty() : Array<T> = if (this != null) this else array<T>()