sortBy<R extends Comparable> method

void sortBy<R extends Comparable>(
  1. R selector(
    1. T
    )
)

Sorts elements in the list in-place according to natural sort order of the value returned by specified selector function.

Implementation

void sortBy<R extends Comparable>(R Function(T) selector) {
  if (size > 1) {
    sortWith(compareBy(selector));
  }
}