addEntries method

IMap<K, V> addEntries(
  1. Iterable<MapEntry<K, V>> entries
)

Returns a new map containing the current map plus the given entries. Note: entries that already exist in the original map will overwrite those of the original map, in place (keeping order).

Implementation

IMap<K, V> addEntries(Iterable<MapEntry<K, V>> entries) {
  IMap<K, V> result;
  result = config.sort
      ? IMap._unsafe(MFlat.fromEntries(_m.entries.followedBy(entries), config: config),
          config: config)
      : IMap<K, V>._unsafe(_m.addEntries(entries), config: config);

  result._counter = _counter;
  result._count();

  return result;
}