compareLists<T extends Comparable<T> > function
Implementation
int compareLists<T extends Comparable<T>>(List<T> a, List<T> b) {
final aLength = a.length;
final bLength = b.length;
final minLength = aLength < bLength ? aLength : bLength;
for (int i = 0; i < minLength; i++) {
final result = a[i].compareTo(b[i]);
if (result != 0) return result;
}
return aLength - bLength;
}