removed extensions toMutableList/Collection/Set from stdlib

This commit is contained in:
Svetlana Isakova
2012-09-10 18:25:00 +04:00
parent b343602f0e
commit 5e18ba9241
11 changed files with 11 additions and 110 deletions
+1 -10
View File
@@ -234,7 +234,7 @@ public inline fun <in T, C: MutableCollection<in T>> Iterable<T>.toCollection(re
* @includeFunctionBody ../../test/CollectionTest.kt reverse
*/
public inline fun <T> Iterable<T>.reverse() : List<T> {
val list = toMutableList()
val list = toCollection(ArrayList<T>())
Collections.reverse(list)
return list
}
@@ -251,15 +251,6 @@ public inline fun <in T> Iterable<T>.toCollection() : Collection<T> = toCollecti
/** Copies all elements into a [[Set]] */
public inline fun <in T> Iterable<T>.toSet() : Set<T> = toCollection(HashSet<T>())
/** Copies all elements into a [[MutableList]] */
public inline fun <in T> Iterable<T>.toMutableList() : MutableList<T> = toCollection(ArrayList<T>())
/** Copies all elements into a [[List] */
public inline fun <in T> Iterable<T>.toMutableCollection() : MutableCollection<T> = toCollection(ArrayList<T>())
/** Copies all elements into a [[Set]] */
public inline fun <in T> Iterable<T>.toMutableSet() : MutableSet<T> = toCollection(HashSet<T>())
/**
TODO figure out necessary variance/generics ninja stuff... :)
public inline fun <in T> Iterable<T>.toSortedList(transform: fun(T) : java.lang.Comparable<*>) : List<T> {