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