Remove dead commented code.
This commit is contained in:
@@ -88,24 +88,6 @@ public fun <T> Collection<T>?.orEmpty(): Collection<T> = this ?: stdlib_emptyLis
|
|||||||
/** Returns the List if its not null otherwise returns the empty list */
|
/** Returns the List if its not null otherwise returns the empty list */
|
||||||
public fun <T> List<T>?.orEmpty(): List<T> = this ?: stdlib_emptyList()
|
public fun <T> List<T>?.orEmpty(): List<T> = this ?: stdlib_emptyList()
|
||||||
|
|
||||||
/**
|
|
||||||
TODO figure out necessary variance/generics ninja stuff... :)
|
|
||||||
public inline fun <in T> List<T>.sort(transform: fun(T) : java.lang.Comparable<*>) : List<T> {
|
|
||||||
val comparator = java.util.Comparator<T>() {
|
|
||||||
public fun compare(o1: T, o2: T): Int {
|
|
||||||
val v1 = transform(o1)
|
|
||||||
val v2 = transform(o2)
|
|
||||||
if (v1 == v2) {
|
|
||||||
return 0
|
|
||||||
} else {
|
|
||||||
return v1.compareTo(v2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
answer.sort(comparator)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the first item in the list or null if the list is empty
|
* Returns the first item in the list or null if the list is empty
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user