hash method

int hash (Iterable<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

int hash(T elements) {
  if (elements == null) return null.hashCode;
  int hash = 0;
  for (E element in elements) {
    int 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;
}