matches method

bool matches(
  1. Float32List a,
  2. int n
)

Whether the first n elements of a are, bit for bit, this default. n must not exceed a.length (an index past it throws, as on any typed list). A length mismatch reads no element; there is no allocation, and no mutation, unless the default holds a NaN.

Implementation

@pragma('vm:prefer-inline')
bool matches(Float32List a, int n) {
  final b = list;
  if (n != b.length) return false;
  final z = _split;
  var i = 0;
  for (; i < z; i++) {
    if (a[i] != b[i]) return _hasNaN && _exactBits(a, b, n);
  }
  if (z == n) return true;
  final x = a[z];
  if (x != 0 || x.isNegative != _splitNeg) {
    return _hasNaN && _exactBits(a, b, n);
  }
  for (i = z + 1; i < n; i++) {
    if (a[i] != b[i]) return _hasNaN && _exactBits(a, b, n);
  }
  return !_moreZeros || _restSignsMatch(a, _zeroRest);
}