EqualitySet<E>.from constructor

EqualitySet<E>.from(
  1. Equality<E> equality,
  2. 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(LinkedHashSet(
          equals: equality.equals,
          hashCode: equality.hash,
          isValidKey: equality.isValidKey)) {
  addAll(other);
}