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