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