EqualitySet<E>.from constructor

EqualitySet<E>.from(Equality<E> equality, Iterable<E> other)

Creates a set with equality based on equality that contains all elements in other.

If other has multiple values that are equivalent according to equality, the first one reached during iteration takes precedence.

Implementation

EqualitySet.from(Equality<E> equality, Iterable<E> other)
    : super(new LinkedHashSet(
          equals: equality.equals,
          hashCode: equality.hash,
          isValidKey: equality.isValidKey)) {
  addAll(other);
}