iListSublistEquality<T> function

bool iListSublistEquality<T>(
  1. IList<T> prev,
  2. IList<T> next
)

Implementation

bool iListSublistEquality<T>(IList<T> prev, IList<T> next) {
  final prevLength = prev.length;
  final nextLength = next.length;

  if (prevLength == nextLength) {
    return prev == next;
  } else if (next.isEmpty || prevLength < nextLength) {
    return false;
  }

  return prev.sublist(0, nextLength) == next;
}