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