EqualityMap<K, V>.from constructor

EqualityMap<K, V>.from(Equality<K> equality, Map<K, V> other)

Creates a map with equality based on equality that contains all key-value pairs of other.

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

Implementation

EqualityMap.from(Equality<K> equality, Map<K, V> other)
    : super(new LinkedHashMap(
          equals: equality.equals,
          hashCode: equality.hash,
          isValidKey: equality.isValidKey)) {
  addAll(other);
}