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