Force a capacity

Property definitions

core $ HashCollection :: enlarge
	# Force a capacity
	fun enlarge(cap: Int)
	do
		# get a new capacity
		if cap < _the_length + 1 then cap = _the_length + 1
		if cap <= _capacity then return
		_capacity = cap
		_last_accessed_key = null

		# get a new array
		var new_array = new NativeArray[nullable N](cap)
		_array = new_array

		# Reput items in the array
		var node = _first_item
		while node != null do
			var index = index_at(node._key)
			# Then store it in the array
			var next = new_array[index]
			new_array[index] = node
			node._prev_in_bucklet = null
			node._next_in_bucklet = next
			if next != null then next._prev_in_bucklet = node
			node = node._next_item
		end
	end
lib/core/collection/hash_collection.nit:170,2--195,4

hash_debug :: hash_debug $ HashCollection :: enlarge
	redef fun enlarge(c)
	do
		super
		sys.en_count += 1
		sys.en_tot_length += _the_length
		sys.en_tot_cap += _capacity
	end
lib/hash_debug/hash_debug.nit:148,2--154,4