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