Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
crossinline modifier | High performance with idiomatic Kotlin
inline fun <T, R : Comparable<R>> Iterable<T>.sortedBy(crossinline selector: (T) -> R?): List<T> {
return sortedWith(compareBy(selector))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment