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