package d0.t; import d0.t.q0.c; import d0.z.d.m; import java.util.Collections; import java.util.Comparator; import java.util.Map; import java.util.SortedMap; import java.util.TreeMap; import kotlin.Pair; /* compiled from: MapsJVM.kt */ public class g0 extends f0 { public static final Map build(Map map) { m.checkNotNullParameter(map, "builder"); return ((c) map).build(); } public static final Map createMapBuilder() { return new c(); } public static final int mapCapacity(int i) { if (i < 0) { return i; } if (i < 3) { return i + 1; } if (i < 1073741824) { return (int) ((((float) i) / 0.75f) + 1.0f); } return Integer.MAX_VALUE; } public static final Map mapOf(Pair pair) { m.checkNotNullParameter(pair, "pair"); Map singletonMap = Collections.singletonMap(pair.getFirst(), pair.getSecond()); m.checkNotNullExpressionValue(singletonMap, "java.util.Collections.si…(pair.first, pair.second)"); return singletonMap; } public static final Map toSingletonMap(Map map) { m.checkNotNullParameter(map, "$this$toSingletonMap"); Map.Entry next = map.entrySet().iterator().next(); Map singletonMap = Collections.singletonMap(next.getKey(), next.getValue()); m.checkNotNullExpressionValue(singletonMap, "with(entries.iterator().…ingletonMap(key, value) }"); return singletonMap; } public static final , V> SortedMap toSortedMap(Map map) { m.checkNotNullParameter(map, "$this$toSortedMap"); return new TreeMap(map); } public static final SortedMap toSortedMap(Map map, Comparator comparator) { m.checkNotNullParameter(map, "$this$toSortedMap"); m.checkNotNullParameter(comparator, "comparator"); TreeMap treeMap = new TreeMap(comparator); treeMap.putAll(map); return treeMap; } }