public static void putAll(final InternalCharDoubleMapOps map, Map<? extends Character, ? extends Double> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof CharDoubleMap) { if (another instanceof InternalCharDoubleMapOps) { ((InternalCharDoubleMapOps) another).reversePutAllTo(map); } else { ((CharDoubleMap) another).forEach(new CharDoubleConsumer() { @Override public void accept(char key, double value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Character, ? extends Double> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
public static void putAll(final InternalCharDoubleMapOps map, Map<? extends Character, ? extends Double> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof CharDoubleMap) { if (another instanceof InternalCharDoubleMapOps) { ((InternalCharDoubleMapOps) another).reversePutAllTo(map); } else { ((CharDoubleMap) another).forEach(new CharDoubleConsumer() { @Override public void accept(char key, double value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Character, ? extends Double> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }