operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

Returns true if this Int64 has the same numeric value as the given object. The argument may be an int or an IntX.

Implementation

@override
bool operator ==(Object other) {
  Int64? o;
  if (other is Int64) {
    o = other;
  } else if (other is int) {
    if (_h == 0 && _m == 0) return _l == other;
    // Since we know one of [_h] or [_m] is non-zero, if [other] fits in the
    // low word then it can't be numerically equal.
    if ((_MASK & other) == other) return false;
    o = Int64(other);
  } else if (other is Int32) {
    o = other.toInt64();
  }
  if (o != null) {
    return _l == o._l && _m == o._m && _h == o._h;
  }
  return false;
}