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