package j.k0;

import java.util.Collections;
import java.util.Map;

/* JADX INFO: compiled from: MapsJVM.kt */
/* JADX INFO: loaded from: classes.dex */
class j0 extends i0 {
    public static int b(int i2) {
        if (i2 < 0) {
            return i2;
        }
        if (i2 < 3) {
            return i2 + 1;
        }
        if (i2 < 1073741824) {
            return (int) ((i2 / 0.75f) + 1.0f);
        }
        return Integer.MAX_VALUE;
    }

    public static <K, V> Map<K, V> c(j.p<? extends K, ? extends V> pVar) {
        j.p0.d.r.f(pVar, "pair");
        Map<K, V> mapSingletonMap = Collections.singletonMap(pVar.c(), pVar.d());
        j.p0.d.r.e(mapSingletonMap, "singletonMap(pair.first, pair.second)");
        return mapSingletonMap;
    }

    public static final <K, V> Map<K, V> d(Map<? extends K, ? extends V> map) {
        j.p0.d.r.f(map, "<this>");
        Map.Entry<? extends K, ? extends V> next = map.entrySet().iterator().next();
        Map<K, V> mapSingletonMap = Collections.singletonMap(next.getKey(), next.getValue());
        j.p0.d.r.e(mapSingletonMap, "with(entries.iterator().…ingletonMap(key, value) }");
        return mapSingletonMap;
    }
}
