Add each (key,value) of map into self.

If a same key exists in map and self, then the value in self is discarded.

var x = new HashMap[String, Int]
x["four"] = 4
x["five"] = 5
var y = new HashMap[String, Int]
y["four"] = 40
y["nine"] = 90
x.add_all y
assert x["four"]  == 40
assert x["five"]  == 5
assert x["nine"]  == 90

Property definitions

core $ Map :: add_all
	# Add each (key,value) of `map` into `self`.
	# If a same key exists in `map` and `self`, then the value in self is discarded.
	#
	#     var x = new HashMap[String, Int]
	#     x["four"] = 4
	#     x["five"] = 5
	#     var y = new HashMap[String, Int]
	#     y["four"] = 40
	#     y["nine"] = 90
	#     x.add_all y
	#     assert x["four"]  == 40
	#     assert x["five"]  == 5
	#     assert x["nine"]  == 90
	fun add_all(map: MapRead[K, V])
	do
		var i = map.iterator
		while i.is_ok do
			self[i.key] = i.item
			i.next
		end
	end
lib/core/collection/abstract_collection.nit:728,2--748,4

counter $ Counter :: add_all
	redef fun add_all(other) do
		for k, v in other do
			self[k] += v
		end
	end
lib/counter/counter.nit:83,2--87,4