public static /*<>*/ void putAll(final InternalByteShortMapOps/*<>*/ map, Map<? extends Byte, ? extends Short> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ByteShortMap) { if (another instanceof InternalByteShortMapOps) { ((InternalByteShortMapOps) another).reversePutAllTo(map); } else { ((ByteShortMap) another).forEach(new /*f*/ByteShortConsumer/*<>*/() { @Override public void accept(byte key, short value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Byte, ? extends Short> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
public static /*<>*/ void putAll(final InternalByteShortMapOps/*<>*/ map, Map<? extends Byte, ? extends Short> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ByteShortMap) { if (another instanceof InternalByteShortMapOps) { ((InternalByteShortMapOps) another).reversePutAllTo(map); } else { ((ByteShortMap) another).forEach(new /*f*/ByteShortConsumer/*<>*/() { @Override public void accept(byte key, short value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Byte, ? extends Short> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }