mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-14 09:57:16 +01:00
452 lines
22 KiB
Java
452 lines
22 KiB
Java
package androidx.collection;
|
|
|
|
import androidx.collection.internal.RuntimeHelpersKt;
|
|
import com.amazon.clouddrive.extended.model.BulkOperationType;
|
|
import com.dee.app.metrics.MetricsConstants;
|
|
import kotlin.Metadata;
|
|
import kotlin.PublishedApi;
|
|
import kotlin.collections.ArraysKt;
|
|
import kotlin.collections.ArraysKt___ArraysJvmKt;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000J\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\b\n\u0002\u0010\u0007\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0014\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\u0018\u00002\u00020\u0001B\u000f\u0012\b\b\u0002\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\r\u0010\u0006\u001a\u00020\u0007H\u0000¢\u0006\u0002\b\bJ\u0006\u0010\t\u001a\u00020\u0007J\r\u0010\n\u001a\u00020\u0007H\u0000¢\u0006\u0002\b\u000bJ\u0010\u0010\f\u001a\u00020\u00032\u0006\u0010\r\u001a\u00020\u0003H\u0002J\u0010\u0010\u000e\u001a\u00020\u00032\u0006\u0010\u000f\u001a\u00020\u0010H\u0002J\"\u0010\u0011\u001a\u00020\u00032\u0006\u0010\u000f\u001a\u00020\u00102\f\u0010\u0012\u001a\b\u0012\u0004\u0012\u00020\u00030\u0013H\u0086\bø\u0001\u0000J\b\u0010\u0014\u001a\u00020\u0007H\u0002J\u0010\u0010\u0015\u001a\u00020\u00072\u0006\u0010\u0016\u001a\u00020\u0003H\u0002J\u0010\u0010\u0017\u001a\u00020\u00072\u0006\u0010\u0002\u001a\u00020\u0003H\u0002J\u0011\u0010\u0018\u001a\u00020\u00072\u0006\u0010\u0019\u001a\u00020\u001aH\u0086\nJ\u0011\u0010\u0018\u001a\u00020\u00072\u0006\u0010\u0019\u001a\u00020\u001bH\u0086\nJ\u0011\u0010\u0018\u001a\u00020\u00072\u0006\u0010\u000f\u001a\u00020\u0010H\u0086\nJ\u0011\u0010\u0018\u001a\u00020\u00072\u0006\u0010\u0019\u001a\u00020\u001cH\u0086\nJ\u0011\u0010\u001d\u001a\u00020\u00072\u0006\u0010\u001e\u001a\u00020\u0001H\u0086\nJ\u0016\u0010\u001f\u001a\u00020\u00072\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010 \u001a\u00020\u0003J\u001e\u0010\u001f\u001a\u00020\u00032\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010 \u001a\u00020\u00032\u0006\u0010!\u001a\u00020\u0003J\u000e\u0010\"\u001a\u00020\u00072\u0006\u0010\u001e\u001a\u00020\u0001J\u000e\u0010#\u001a\u00020\u00072\u0006\u0010\u000f\u001a\u00020\u0010J\u0016\u0010#\u001a\u00020$2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010 \u001a\u00020\u0003J&\u0010%\u001a\u00020\u00072\u0018\u0010&\u001a\u0014\u0012\u0004\u0012\u00020\u0010\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020$0'H\u0086\bø\u0001\u0000J\u0010\u0010(\u001a\u00020\u00072\u0006\u0010)\u001a\u00020\u0003H\u0001J\u0015\u0010*\u001a\u00020\u00072\u0006\u0010+\u001a\u00020\u0003H\u0000¢\u0006\u0002\b,J\u0019\u0010-\u001a\u00020\u00072\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010 \u001a\u00020\u0003H\u0086\u0002J\u0006\u0010.\u001a\u00020\u0003R\u000e\u0010\u0005\u001a\u00020\u0003X\u0082\u000e¢\u0006\u0002\n\u0000\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006/"}, d2 = {"Landroidx/collection/MutableFloatIntMap;", "Landroidx/collection/FloatIntMap;", "initialCapacity", "", "(I)V", "growthLimit", "adjustStorage", "", "adjustStorage$collection", MetricsConstants.Method.CACHE_CLEAR, "dropDeletes", "dropDeletes$collection", "findFirstAvailableSlot", "hash1", "findInsertIndex", "key", "", "getOrPut", "defaultValue", "Lkotlin/Function0;", "initializeGrowth", "initializeMetadata", "capacity", "initializeStorage", "minusAssign", "keys", "Landroidx/collection/FloatList;", "Landroidx/collection/FloatSet;", "", "plusAssign", "from", MetricsConstants.Method.CACHE_PUT, "value", "default", "putAll", BulkOperationType.remove, "", "removeIf", "predicate", "Lkotlin/Function2;", "removeValueAt", "index", "resizeStorage", "newCapacity", "resizeStorage$collection", "set", "trim", "collection"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nFloatIntMap.kt\nKotlin\n*S Kotlin\n*F\n+ 1 FloatIntMap.kt\nandroidx/collection/MutableFloatIntMap\n+ 2 RuntimeHelpers.kt\nandroidx/collection/internal/RuntimeHelpersKt\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 4 ScatterMap.kt\nandroidx/collection/ScatterMapKt\n+ 5 FloatIntMap.kt\nandroidx/collection/FloatIntMap\n+ 6 FloatSet.kt\nandroidx/collection/FloatSet\n+ 7 FloatList.kt\nandroidx/collection/FloatList\n+ 8 FloatSet.kt\nandroidx/collection/FloatSetKt\n*L\n1#1,1034:1\n59#2,5:1035\n1#3:1040\n1254#4,6:1041\n1399#4:1057\n1270#4:1061\n1399#4:1078\n1270#4:1082\n1399#4:1103\n1270#4:1107\n1230#4:1124\n1254#4,6:1125\n1242#4:1131\n1241#4,4:1132\n1254#4,6:1136\n1175#4:1145\n1179#4:1146\n1372#4,3:1147\n1386#4,3:1150\n1312#4:1153\n1303#4:1154\n1297#4:1155\n1309#4:1156\n1393#4:1157\n1265#4:1158\n1220#4:1159\n1262#4:1160\n1220#4:1161\n1230#4:1162\n1254#4,6:1163\n1242#4:1169\n1241#4,4:1170\n1372#4,3:1174\n1399#4:1177\n1297#4:1178\n1144#4,14:1179\n1220#4:1193\n1175#4:1197\n1179#4:1198\n1254#4,6:1199\n1220#4:1205\n1179#4:1206\n1254#4,6:1207\n1254#4,6:1213\n1179#4:1219\n1254#4,6:1220\n1268#4:1226\n1220#4:1227\n1175#4:1231\n1179#4:1232\n1230#4:1233\n1254#4,6:1234\n1242#4:1240\n1241#4,4:1241\n387#5,4:1047\n359#5,6:1051\n369#5,3:1058\n372#5,9:1062\n391#5:1071\n359#5,6:1072\n369#5,3:1079\n372#5,9:1083\n257#6,4:1092\n227#6,7:1096\n238#6,3:1104\n241#6,9:1108\n261#6:1117\n237#7,6:1118\n882#8,3:1142\n882#8,3:1194\n882#8,3:1228\n*S KotlinDebug\n*F\n+ 1 FloatIntMap.kt\nandroidx/collection/MutableFloatIntMap\n*L\n639#1:1035,5\n667#1:1041,6\n739#1:1057\n739#1:1061\n770#1:1078\n770#1:1082\n791#1:1103\n791#1:1107\n805#1:1124\n805#1:1125,6\n805#1:1131\n805#1:1132,4\n813#1:1136,6\n826#1:1145\n827#1:1146\n834#1:1147,3\n835#1:1150,3\n836#1:1153\n837#1:1154\n837#1:1155\n841#1:1156\n844#1:1157\n853#1:1158\n853#1:1159\n859#1:1160\n859#1:1161\n860#1:1162\n860#1:1163,6\n860#1:1169\n860#1:1170,4\n875#1:1174,3\n876#1:1177\n878#1:1178\n924#1:1179,14\n930#1:1193\n945#1:1197\n956#1:1198\n957#1:1199,6\n967#1:1205\n970#1:1206\n971#1:1207,6\n972#1:1213,6\n982#1:1219\n983#1:1220,6\n1022#1:1226\n1022#1:1227\n1025#1:1231\n1027#1:1232\n1027#1:1233\n1027#1:1234,6\n1027#1:1240\n1027#1:1241,4\n739#1:1047,4\n739#1:1051,6\n739#1:1058,3\n739#1:1062,9\n739#1:1071\n770#1:1072,6\n770#1:1079,3\n770#1:1083,9\n791#1:1092,4\n791#1:1096,7\n791#1:1104,3\n791#1:1108,9\n791#1:1117\n796#1:1118,6\n825#1:1142,3\n944#1:1194,3\n1024#1:1228,3\n*E\n"})
|
|
/* loaded from: classes.dex */
|
|
public final class MutableFloatIntMap extends FloatIntMap {
|
|
private int growthLimit;
|
|
|
|
public MutableFloatIntMap(int i) {
|
|
super(null);
|
|
if (!(i >= 0)) {
|
|
RuntimeHelpersKt.throwIllegalArgumentException("Capacity must be a positive value.");
|
|
}
|
|
initializeStorage(ScatterMapKt.unloadedCapacity(i));
|
|
}
|
|
|
|
private final int findFirstAvailableSlot(int hash1) {
|
|
int i = this._capacity;
|
|
int i2 = hash1 & i;
|
|
int i3 = 0;
|
|
while (true) {
|
|
long[] jArr = this.metadata;
|
|
int i4 = i2 >> 3;
|
|
int i5 = (i2 & 7) << 3;
|
|
long j = ((jArr[i4 + 1] << (64 - i5)) & ((-i5) >> 63)) | (jArr[i4] >>> i5);
|
|
long j2 = j & ((~j) << 7) & (-9187201950435737472L);
|
|
if (j2 != 0) {
|
|
return (i2 + (Long.numberOfTrailingZeros(j2) >> 3)) & i;
|
|
}
|
|
i3 += 8;
|
|
i2 = (i2 + i3) & i;
|
|
}
|
|
}
|
|
|
|
private final int findInsertIndex(float key) {
|
|
int hashCode = Float.hashCode(key) * ScatterMapKt.MurmurHashC1;
|
|
int i = hashCode ^ (hashCode << 16);
|
|
int i2 = i >>> 7;
|
|
int i3 = i & 127;
|
|
int i4 = this._capacity;
|
|
int i5 = i2 & i4;
|
|
int i6 = 0;
|
|
while (true) {
|
|
long[] jArr = this.metadata;
|
|
int i7 = i5 >> 3;
|
|
int i8 = (i5 & 7) << 3;
|
|
long j = ((jArr[i7 + 1] << (64 - i8)) & ((-i8) >> 63)) | (jArr[i7] >>> i8);
|
|
long j2 = i3;
|
|
int i9 = i6;
|
|
long j3 = j ^ (j2 * ScatterMapKt.BitmaskLsb);
|
|
for (long j4 = (~j3) & (j3 - ScatterMapKt.BitmaskLsb) & (-9187201950435737472L); j4 != 0; j4 &= j4 - 1) {
|
|
int numberOfTrailingZeros = ((Long.numberOfTrailingZeros(j4) >> 3) + i5) & i4;
|
|
if (this.keys[numberOfTrailingZeros] == key) {
|
|
return numberOfTrailingZeros;
|
|
}
|
|
}
|
|
if ((((~j) << 6) & j & (-9187201950435737472L)) != 0) {
|
|
int findFirstAvailableSlot = findFirstAvailableSlot(i2);
|
|
if (this.growthLimit == 0 && ((this.metadata[findFirstAvailableSlot >> 3] >> ((findFirstAvailableSlot & 7) << 3)) & 255) != 254) {
|
|
adjustStorage$collection();
|
|
findFirstAvailableSlot = findFirstAvailableSlot(i2);
|
|
}
|
|
this._size++;
|
|
int i10 = this.growthLimit;
|
|
long[] jArr2 = this.metadata;
|
|
int i11 = findFirstAvailableSlot >> 3;
|
|
long j5 = jArr2[i11];
|
|
int i12 = (findFirstAvailableSlot & 7) << 3;
|
|
this.growthLimit = i10 - (((j5 >> i12) & 255) == 128 ? 1 : 0);
|
|
int i13 = this._capacity;
|
|
long j6 = ((~(255 << i12)) & j5) | (j2 << i12);
|
|
jArr2[i11] = j6;
|
|
jArr2[(((findFirstAvailableSlot - 7) & i13) + (i13 & 7)) >> 3] = j6;
|
|
return ~findFirstAvailableSlot;
|
|
}
|
|
i6 = i9 + 8;
|
|
i5 = (i5 + i6) & i4;
|
|
}
|
|
}
|
|
|
|
private final void initializeGrowth() {
|
|
this.growthLimit = ScatterMapKt.loadedCapacity(get_capacity()) - this._size;
|
|
}
|
|
|
|
private final void initializeMetadata(int capacity) {
|
|
long[] jArr;
|
|
if (capacity == 0) {
|
|
jArr = ScatterMapKt.EmptyGroup;
|
|
} else {
|
|
jArr = new long[((capacity + 15) & (-8)) >> 3];
|
|
ArraysKt___ArraysJvmKt.fill$default(jArr, -9187201950435737472L, 0, 0, 6, (Object) null);
|
|
}
|
|
this.metadata = jArr;
|
|
int i = capacity >> 3;
|
|
long j = 255 << ((capacity & 7) << 3);
|
|
jArr[i] = (jArr[i] & (~j)) | j;
|
|
initializeGrowth();
|
|
}
|
|
|
|
private final void initializeStorage(int initialCapacity) {
|
|
int max = initialCapacity > 0 ? Math.max(7, ScatterMapKt.normalizeCapacity(initialCapacity)) : 0;
|
|
this._capacity = max;
|
|
initializeMetadata(max);
|
|
this.keys = new float[max];
|
|
this.values = new int[max];
|
|
}
|
|
|
|
public final void adjustStorage$collection() {
|
|
if (this._capacity <= 8 || Long.compareUnsigned(DoubleList$$ExternalSyntheticOutline0.m(this._size, 32L), DoubleList$$ExternalSyntheticOutline0.m(this._capacity, 25L)) > 0) {
|
|
resizeStorage$collection(ScatterMapKt.nextCapacity(this._capacity));
|
|
} else {
|
|
dropDeletes$collection();
|
|
}
|
|
}
|
|
|
|
public final void clear() {
|
|
this._size = 0;
|
|
long[] jArr = this.metadata;
|
|
if (jArr != ScatterMapKt.EmptyGroup) {
|
|
ArraysKt___ArraysJvmKt.fill$default(jArr, -9187201950435737472L, 0, 0, 6, (Object) null);
|
|
long[] jArr2 = this.metadata;
|
|
int i = this._capacity;
|
|
int i2 = i >> 3;
|
|
long j = 255 << ((i & 7) << 3);
|
|
jArr2[i2] = (jArr2[i2] & (~j)) | j;
|
|
}
|
|
initializeGrowth();
|
|
}
|
|
|
|
public final void dropDeletes$collection() {
|
|
long j;
|
|
long[] jArr = this.metadata;
|
|
int i = this._capacity;
|
|
float[] fArr = this.keys;
|
|
int[] iArr = this.values;
|
|
int i2 = (i + 7) >> 3;
|
|
int i3 = 0;
|
|
for (int i4 = 0; i4 < i2; i4++) {
|
|
long j2 = jArr[i4] & (-9187201950435737472L);
|
|
jArr[i4] = (-72340172838076674L) & ((~j2) + (j2 >>> 7));
|
|
}
|
|
int lastIndex = ArraysKt.getLastIndex(jArr);
|
|
int i5 = lastIndex - 1;
|
|
long j3 = 72057594037927935L;
|
|
jArr[i5] = (jArr[i5] & 72057594037927935L) | (-72057594037927936L);
|
|
jArr[lastIndex] = jArr[0];
|
|
int i6 = 0;
|
|
while (i6 != i) {
|
|
int i7 = i6 >> 3;
|
|
int i8 = (i6 & 7) << 3;
|
|
long j4 = (jArr[i7] >> i8) & 255;
|
|
if (j4 != 128 && j4 == 254) {
|
|
int hashCode = Float.hashCode(fArr[i6]) * ScatterMapKt.MurmurHashC1;
|
|
int i9 = (hashCode ^ (hashCode << 16)) >>> 7;
|
|
int findFirstAvailableSlot = findFirstAvailableSlot(i9);
|
|
int i10 = i9 & i;
|
|
int i11 = i3;
|
|
if (((findFirstAvailableSlot - i10) & i) / 8 == ((i6 - i10) & i) / 8) {
|
|
jArr[i7] = ((r8 & 127) << i8) | ((~(255 << i8)) & jArr[i7]);
|
|
jArr[ArraysKt.getLastIndex(jArr)] = (jArr[i11] & j3) | Long.MIN_VALUE;
|
|
i6++;
|
|
i3 = i11;
|
|
} else {
|
|
int i12 = findFirstAvailableSlot >> 3;
|
|
long j5 = jArr[i12];
|
|
int i13 = (findFirstAvailableSlot & 7) << 3;
|
|
if (((j5 >> i13) & 255) == 128) {
|
|
j = j3;
|
|
jArr[i12] = ((r8 & 127) << i13) | (j5 & (~(255 << i13)));
|
|
jArr[i7] = (jArr[i7] & (~(255 << i8))) | (128 << i8);
|
|
fArr[findFirstAvailableSlot] = fArr[i6];
|
|
fArr[i6] = 0.0f;
|
|
iArr[findFirstAvailableSlot] = iArr[i6];
|
|
iArr[i6] = i11;
|
|
} else {
|
|
j = j3;
|
|
jArr[i12] = ((r8 & 127) << i13) | (j5 & (~(255 << i13)));
|
|
float f = fArr[findFirstAvailableSlot];
|
|
fArr[findFirstAvailableSlot] = fArr[i6];
|
|
fArr[i6] = f;
|
|
int i14 = iArr[findFirstAvailableSlot];
|
|
iArr[findFirstAvailableSlot] = iArr[i6];
|
|
iArr[i6] = i14;
|
|
i6--;
|
|
}
|
|
jArr[ArraysKt.getLastIndex(jArr)] = (jArr[i11] & j) | Long.MIN_VALUE;
|
|
i6++;
|
|
i3 = i11;
|
|
j3 = j;
|
|
}
|
|
} else {
|
|
i6++;
|
|
}
|
|
}
|
|
initializeGrowth();
|
|
}
|
|
|
|
public final int getOrPut(float key, @NotNull Function0<Integer> defaultValue) {
|
|
defaultValue.getClass();
|
|
int findKeyIndex = findKeyIndex(key);
|
|
if (findKeyIndex >= 0) {
|
|
return this.values[findKeyIndex];
|
|
}
|
|
int intValue = defaultValue.invoke().intValue();
|
|
put(key, intValue);
|
|
return intValue;
|
|
}
|
|
|
|
public final void minusAssign(@NotNull FloatSet keys) {
|
|
keys.getClass();
|
|
float[] fArr = keys.elements;
|
|
long[] jArr = keys.metadata;
|
|
int length = jArr.length - 2;
|
|
if (length < 0) {
|
|
return;
|
|
}
|
|
int i = 0;
|
|
while (true) {
|
|
long j = jArr[i];
|
|
if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) {
|
|
int i2 = 8 - ((~(i - length)) >>> 31);
|
|
for (int i3 = 0; i3 < i2; i3++) {
|
|
if ((255 & j) < 128) {
|
|
remove(fArr[(i << 3) + i3]);
|
|
}
|
|
j >>= 8;
|
|
}
|
|
if (i2 != 8) {
|
|
return;
|
|
}
|
|
}
|
|
if (i == length) {
|
|
return;
|
|
} else {
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void plusAssign(@NotNull FloatIntMap from) {
|
|
from.getClass();
|
|
putAll(from);
|
|
}
|
|
|
|
public final int put(float key, int value, int r5) {
|
|
int findInsertIndex = findInsertIndex(key);
|
|
if (findInsertIndex < 0) {
|
|
findInsertIndex = ~findInsertIndex;
|
|
} else {
|
|
r5 = this.values[findInsertIndex];
|
|
}
|
|
this.keys[findInsertIndex] = key;
|
|
this.values[findInsertIndex] = value;
|
|
return r5;
|
|
}
|
|
|
|
public final void putAll(@NotNull FloatIntMap from) {
|
|
from.getClass();
|
|
float[] fArr = from.keys;
|
|
int[] iArr = from.values;
|
|
long[] jArr = from.metadata;
|
|
int length = jArr.length - 2;
|
|
if (length < 0) {
|
|
return;
|
|
}
|
|
int i = 0;
|
|
while (true) {
|
|
long j = jArr[i];
|
|
if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) {
|
|
int i2 = 8 - ((~(i - length)) >>> 31);
|
|
for (int i3 = 0; i3 < i2; i3++) {
|
|
if ((255 & j) < 128) {
|
|
int i4 = (i << 3) + i3;
|
|
set(fArr[i4], iArr[i4]);
|
|
}
|
|
j >>= 8;
|
|
}
|
|
if (i2 != 8) {
|
|
return;
|
|
}
|
|
}
|
|
if (i == length) {
|
|
return;
|
|
} else {
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
|
|
public final boolean remove(float key, int value) {
|
|
int findKeyIndex = findKeyIndex(key);
|
|
if (findKeyIndex < 0 || this.values[findKeyIndex] != value) {
|
|
return false;
|
|
}
|
|
removeValueAt(findKeyIndex);
|
|
return true;
|
|
}
|
|
|
|
public final void removeIf(@NotNull Function2<? super Float, ? super Integer, Boolean> predicate) {
|
|
predicate.getClass();
|
|
long[] jArr = this.metadata;
|
|
int length = jArr.length - 2;
|
|
if (length < 0) {
|
|
return;
|
|
}
|
|
int i = 0;
|
|
while (true) {
|
|
long j = jArr[i];
|
|
if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) {
|
|
int i2 = 8 - ((~(i - length)) >>> 31);
|
|
for (int i3 = 0; i3 < i2; i3++) {
|
|
if ((255 & j) < 128) {
|
|
int i4 = (i << 3) + i3;
|
|
if (predicate.invoke(Float.valueOf(this.keys[i4]), Integer.valueOf(this.values[i4])).booleanValue()) {
|
|
removeValueAt(i4);
|
|
}
|
|
}
|
|
j >>= 8;
|
|
}
|
|
if (i2 != 8) {
|
|
return;
|
|
}
|
|
}
|
|
if (i == length) {
|
|
return;
|
|
} else {
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
|
|
@PublishedApi
|
|
public final void removeValueAt(int index) {
|
|
this._size--;
|
|
long[] jArr = this.metadata;
|
|
int i = this._capacity;
|
|
int i2 = index >> 3;
|
|
int i3 = (index & 7) << 3;
|
|
long j = (jArr[i2] & (~(255 << i3))) | (254 << i3);
|
|
jArr[i2] = j;
|
|
jArr[(((index - 7) & i) + (i & 7)) >> 3] = j;
|
|
}
|
|
|
|
public final void resizeStorage$collection(int newCapacity) {
|
|
long[] jArr;
|
|
MutableFloatIntMap mutableFloatIntMap = this;
|
|
long[] jArr2 = mutableFloatIntMap.metadata;
|
|
float[] fArr = mutableFloatIntMap.keys;
|
|
int[] iArr = mutableFloatIntMap.values;
|
|
int i = mutableFloatIntMap._capacity;
|
|
initializeStorage(newCapacity);
|
|
long[] jArr3 = mutableFloatIntMap.metadata;
|
|
float[] fArr2 = mutableFloatIntMap.keys;
|
|
int[] iArr2 = mutableFloatIntMap.values;
|
|
int i2 = mutableFloatIntMap._capacity;
|
|
int i3 = 0;
|
|
while (i3 < i) {
|
|
if (((jArr2[i3 >> 3] >> ((i3 & 7) << 3)) & 255) < 128) {
|
|
float f = fArr[i3];
|
|
int hashCode = Float.hashCode(f) * ScatterMapKt.MurmurHashC1;
|
|
int i4 = hashCode ^ (hashCode << 16);
|
|
int findFirstAvailableSlot = mutableFloatIntMap.findFirstAvailableSlot(i4 >>> 7);
|
|
long j = i4 & 127;
|
|
int i5 = findFirstAvailableSlot >> 3;
|
|
int i6 = (findFirstAvailableSlot & 7) << 3;
|
|
jArr = jArr2;
|
|
long j2 = (jArr3[i5] & (~(255 << i6))) | (j << i6);
|
|
jArr3[i5] = j2;
|
|
jArr3[(((findFirstAvailableSlot - 7) & i2) + (i2 & 7)) >> 3] = j2;
|
|
fArr2[findFirstAvailableSlot] = f;
|
|
iArr2[findFirstAvailableSlot] = iArr[i3];
|
|
} else {
|
|
jArr = jArr2;
|
|
}
|
|
i3++;
|
|
mutableFloatIntMap = this;
|
|
jArr2 = jArr;
|
|
}
|
|
}
|
|
|
|
public final void set(float key, int value) {
|
|
int findInsertIndex = findInsertIndex(key);
|
|
if (findInsertIndex < 0) {
|
|
findInsertIndex = ~findInsertIndex;
|
|
}
|
|
this.keys[findInsertIndex] = key;
|
|
this.values[findInsertIndex] = value;
|
|
}
|
|
|
|
public final int trim() {
|
|
int i = this._capacity;
|
|
int normalizeCapacity = ScatterMapKt.normalizeCapacity(ScatterMapKt.unloadedCapacity(this._size));
|
|
if (normalizeCapacity >= i) {
|
|
return 0;
|
|
}
|
|
resizeStorage$collection(normalizeCapacity);
|
|
return i - this._capacity;
|
|
}
|
|
|
|
public final void remove(float key) {
|
|
int findKeyIndex = findKeyIndex(key);
|
|
if (findKeyIndex >= 0) {
|
|
removeValueAt(findKeyIndex);
|
|
}
|
|
}
|
|
|
|
public final void put(float key, int value) {
|
|
set(key, value);
|
|
}
|
|
|
|
public MutableFloatIntMap() {
|
|
this(0, 1, null);
|
|
}
|
|
|
|
public /* synthetic */ MutableFloatIntMap(int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i2 & 1) != 0 ? 6 : i);
|
|
}
|
|
|
|
public final void minusAssign(@NotNull float[] keys) {
|
|
keys.getClass();
|
|
for (float f : keys) {
|
|
remove(f);
|
|
}
|
|
}
|
|
|
|
public final void minusAssign(float key) {
|
|
remove(key);
|
|
}
|
|
|
|
public final void minusAssign(@NotNull FloatList keys) {
|
|
keys.getClass();
|
|
float[] fArr = keys.content;
|
|
int i = keys._size;
|
|
for (int i2 = 0; i2 < i; i2++) {
|
|
remove(fArr[i2]);
|
|
}
|
|
}
|
|
}
|