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