Rollback 0514ddc719 due to failing tests
This commit is contained in:
@@ -75,13 +75,3 @@ public inline fun <T> Iterable<T>.sort(comparator: java.util.Comparator<T>) : Li
|
||||
java.util.Collections.sort(list, comparator)
|
||||
return list
|
||||
}
|
||||
|
||||
public inline fun <T> Iterable<T>.sort(compare: (T, T) -> Int): List<T> {
|
||||
return sort(
|
||||
object : java.util.Comparator<T> {
|
||||
public override fun compare(o1: T, o2: T): Int {
|
||||
return compare.invoke(o1, o2)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public inline fun <T> Collection<T>?.orEmpty() : Collection<T>
|
||||
/** TODO these functions don't work when they generate the Array<T> versions when they are in JLIterables */
|
||||
public inline fun <T: Comparable<T>> Iterable<T>.toSortedList() : List<T> = toCollection(ArrayList<T>()).sort()
|
||||
|
||||
public inline fun <T> Iterable<T>.toSortedList(compare: (T, T) -> Int) : List<T> = toList().sort(compare)
|
||||
public inline fun <T: Comparable<T>> Iterable<T>.toSortedList(comparator: java.util.Comparator<T>) : List<T> = toList().sort(comparator)
|
||||
|
||||
|
||||
// List APIs
|
||||
|
||||
Reference in New Issue
Block a user