| 601 | } |
| 602 | |
| 603 | private void putAllImpl(Map<? extends K, ? extends V> map) { |
| 604 | int capacity = elementCount + map.size(); |
| 605 | if (capacity > threshold) { |
| 606 | rehash(capacity); |
| 607 | } |
| 608 | Iterator it = map.entrySet().iterator(); |
| 609 | while (it.hasNext()) { |
| 610 | Map.Entry<? extends K, ? extends V> entry = (Map.Entry<? extends K, ? extends V>)it.next(); |
| 611 | putImpl(entry.getKey(), entry.getValue()); |
| 612 | } |
| 613 | } |
| 614 | |
| 615 | void rehash(int capacity) { |
| 616 | int length = calculateCapacity((capacity == 0 ? 1 : capacity << 1)); |