Return the key's current value in the map, throwing an exception if the key is not found.
Return the key's current value in the map, throwing an exception if the key is not found.
On average, this is an O(1) operation; the (unlikely) worst-case is O(n).
Grow the underlying array to best accomodate the map's size.
Grow the underlying array to best accomodate the map's size.
To preserve hashing access speed, the map's size should never be more than 66% of the underlying array's size. When this size is reached, the map needs to be updated (using this method) to have a larger array.
The underlying array's size must always be a multiple of 2, which means this method grows the array's size by 2x (or 4x if the map is very small). This doubling helps amortize the cost of resizing, since as the map gets larger growth will happen less frequently. This method returns a null of type Unit1[A] to trigger specialization without allocating an actual instance.
Growing is an O(n) operation, where n is the map's size.
This method stores associates value with key.
This method stores associates value with key.
If a previous value was associated with the key, it is overwritten.
This method is usually invoked as map(key) = value, but can also be invoked as map.update(key, value).
On average, this is an amortized O(1) operation; the worst-case is O(n), which will happen when the map needs to be resized.
Cropped copy of debox.Map. https://raw.githubusercontent.com/non/debox/master/src/main/scala/debox/Map.scala