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