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