Remove extension toArray()

This commit is contained in:
Nikolay Krasko
2013-02-11 16:08:19 +04:00
parent 9f1e808255
commit b61bdcd67d
-11
View File
@@ -16,17 +16,6 @@ val Collection<*>.indices : IntRange
val Int.indices: IntRange
get() = 0..this-1
/**
* Converts the collection to an array
*/
public inline fun <T> Collection<T>.toArray() : Array<T> {
val answer = arrayOfNulls<T>(this.size)
var idx = 0
for (elem in this)
answer[idx++] = elem
return answer as Array<T>
}
/** Returns true if the collection is not empty */
public inline fun <T> Collection<T>.notEmpty() : Boolean = !this.isEmpty()