rangeEquals method
Whether elements in a range of this list equal corresponding elements in
other.
Compares elements of this list from start (inclusive) to end
(exclusive) with elements of other starting at otherStart.
Returns whether all corresponding pairs of elements are equal.
An empty range (start == end) returns true.
The ranges must satisfy 0 ≤ start ≤ end ≤ length and 0 ≤ otherStart
with otherStart + (end - start) ≤ other.length.
Implementation
@pragma('vm:prefer-inline')
@pragma('wasm:prefer-inline')
@pragma('dart2js:prefer-inline')
bool rangeEquals(int start, int end, Int32List other, [int otherStart = 0]) {
final count = _rangeEqualsBoundsCheck(
length,
start,
end,
other.length,
otherStart,
);
if (count == 0) return true;
if (identical(this, other) && start == otherStart) return true;
return _int32ListRangeEquals(this, start, other, otherStart, count);
}