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