addMap method

IMap<K, V> addMap(
  1. Map<K, V> map
)

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

Implementation

IMap<K, V> addMap(Map<K, V> map) {
  IMap<K, V> result = config.sort
      ? IMap._unsafe(MFlat.fromEntries(_m.entries.followedBy(map.entries), config: config),
          config: config)
      : IMap<K, V>._unsafe(_m.addMap(map), config: config);

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

  return result;
}