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