asSortedList method

List<num> asSortedList()

Returns a sorted List<double> of this numeric collection. If this instance is already sorted and already a List<int>, returns this instance.

Implementation

List<num> asSortedList() {
  List<num> list;
  if (this is List<num> && isSorted) {
    list = this as List<num>;
  } else {
    list = toList();
    list.sort();
  }
  return list;
}