hash method

  1. @override
int hash (
  1. Set<E> elements
)
inherited

Get a hashcode of an element.

The hashcode should be compatible with equals, so that if equals(a, b) then hash(a) == hash(b).

Implementation

@override
int hash(T elements) {
  if (elements == null) return null.hashCode;
  var hash = 0;
  for (E element in elements) {
    var c = _elementEquality.hash(element);
    hash = (hash + c) & _HASH_MASK;
  }
  hash = (hash + (hash << 3)) & _HASH_MASK;
  hash ^= (hash >> 11);
  hash = (hash + (hash << 15)) & _HASH_MASK;
  return hash;
}