| 587 | } |
| 588 | |
| 589 | private void putAllImpl(Map<? extends K, ? extends V> map) { |
| 590 | int capacity = elementCount + map.size(); |
| 591 | if (capacity > threshold) { |
| 592 | rehash(capacity); |
| 593 | } |
| 594 | Iterator it = map.entrySet().iterator(); |
| 595 | while (it.hasNext()) { |
| 596 | Map.Entry<? extends K, ? extends V> entry = (Map.Entry<? extends K, ? extends V>)it.next(); |
| 597 | putImpl(entry.getKey(), entry.getValue()); |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | void rehash(int capacity) { |
| 602 | int length = calculateCapacity((capacity == 0 ? 1 : capacity << 1)); |