equals<T> static method

bool equals<T>(
  1. List<T> a,
  2. List<T> b
)

Implementation

static bool equals<T>(List<T> a, List<T> b) {
  if (identical(a, b)) {
    // same object
    return true;
  } else if (a.length != b.length) {
    // different size
    return false;
  }
  for (int index = 0; index < a.length; ++index) {
    // check values
    if (a[index] != b[index]) {
      return false;
    }
  }
  return true;
}