sort<T> method

void sort<T>(
  1. Comparable<T>? getField(
    1. ClassHeapStats d
    ),
  2. bool descending,
  3. void completion()
)

Implementation

void sort<T>(Comparable<T>? Function(ClassHeapStats d) getField,
    bool descending, void Function() completion) {
  s(List list) {
    list.sort((a, b) {
      final aValue = getField(a);
      final bValue = getField(b);
      return descending
          ? Comparable.compare(bValue!, aValue!)
          : Comparable.compare(aValue!, bValue!);
    });
  }

  s(infoList);
  s(allClasses);
  completion();
}