compareBytes function

int compareBytes(
  1. List<int> a,
  2. List<int> b,
  3. bool asc
)

Implementation

int compareBytes(List<int> a, List<int> b, bool asc) {
  for (int i = 0; i < a.length && i < b.length; i++) {
    final x = a[i].compareTo(b[i]);
    if (x != 0) return asc ? x : -x;
  }
  final x = a.length.compareTo(b.length);
  return asc ? x : -x;
}