KT-20357 Add sortedBy() sample (#3283)
This commit is contained in:
@@ -533,6 +533,8 @@ public fun <T : Comparable<T>> Sequence<T>.sorted(): Sequence<T> {
|
||||
* The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
|
||||
*
|
||||
* The operation is _intermediate_ and _stateful_.
|
||||
*
|
||||
* @sample samples.collections.Collections.Sorting.sortedBy
|
||||
*/
|
||||
public inline fun <T, R : Comparable<R>> Sequence<T>.sortedBy(crossinline selector: (T) -> R?): Sequence<T> {
|
||||
return sortedWith(compareBy(selector))
|
||||
|
||||
Reference in New Issue
Block a user