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