operator == method

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

A PbMap is equal to another PbMap with equal key/value pairs in any order.

Implementation

@override
bool operator ==(other) {
  if (identical(other, this)) {
    return true;
  }
  if (other is! PbMap) {
    return false;
  }
  if (other.length != length) {
    return false;
  }
  for (final key in keys) {
    if (!other.containsKey(key)) {
      return false;
    }
  }
  for (final key in keys) {
    if (other[key] != this[key]) {
      return false;
    }
  }
  return true;
}