compare method

bool compare(
  1. Vector<T> other, {
  2. bool equals(
    1. T a,
    2. T b
    )?,
})

Compares this Vector and with other.

Implementation

bool compare(Vector<T> other, {bool Function(T a, T b)? equals}) {
  if (equals == null && identical(this, other)) {
    return true;
  }
  if (count != other.count) {
    return false;
  }
  equals ??= dataType.equality.isEqual;
  for (var i = 0; i < count; i++) {
    if (!equals(getUnchecked(i), other.getUnchecked(i))) {
      return false;
    }
  }
  return true;
}