Files
rr3-apk/decompiled/sources/androidx/room/util/RelationUtil.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

115 lines
3.6 KiB
Java

package androidx.room.util;
import androidx.annotation.RestrictTo;
import androidx.collection.ArrayMap;
import androidx.collection.LongSparseArray;
import java.util.HashMap;
import java.util.Map;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
/* loaded from: classes.dex */
public final class RelationUtil {
public static final <K, V> void recursiveFetchHashMap(HashMap<K, V> map, boolean z, Function1 fetchBlock) {
int i;
Intrinsics.checkNotNullParameter(map, "map");
Intrinsics.checkNotNullParameter(fetchBlock, "fetchBlock");
HashMap hashMap = new HashMap(999);
loop0: while (true) {
i = 0;
for (K key : map.keySet()) {
if (z) {
Intrinsics.checkNotNullExpressionValue(key, "key");
hashMap.put(key, map.get(key));
} else {
Intrinsics.checkNotNullExpressionValue(key, "key");
hashMap.put(key, null);
}
i++;
if (i == 999) {
fetchBlock.invoke(hashMap);
if (!z) {
map.putAll(hashMap);
}
hashMap.clear();
}
}
break loop0;
}
if (i > 0) {
fetchBlock.invoke(hashMap);
if (z) {
return;
}
map.putAll(hashMap);
}
}
public static final <V> void recursiveFetchLongSparseArray(LongSparseArray<V> map, boolean z, Function1 fetchBlock) {
Intrinsics.checkNotNullParameter(map, "map");
Intrinsics.checkNotNullParameter(fetchBlock, "fetchBlock");
LongSparseArray<? extends V> longSparseArray = new LongSparseArray<>(999);
int size = map.size();
int i = 0;
int i2 = 0;
while (i < size) {
if (z) {
longSparseArray.put(map.keyAt(i), map.valueAt(i));
} else {
longSparseArray.put(map.keyAt(i), null);
}
i++;
i2++;
if (i2 == 999) {
fetchBlock.invoke(longSparseArray);
if (!z) {
map.putAll(longSparseArray);
}
longSparseArray.clear();
i2 = 0;
}
}
if (i2 > 0) {
fetchBlock.invoke(longSparseArray);
if (z) {
return;
}
map.putAll(longSparseArray);
}
}
public static final <K, V> void recursiveFetchArrayMap(ArrayMap<K, V> map, boolean z, Function1 fetchBlock) {
Intrinsics.checkNotNullParameter(map, "map");
Intrinsics.checkNotNullParameter(fetchBlock, "fetchBlock");
ArrayMap arrayMap = new ArrayMap(999);
int size = map.size();
int i = 0;
int i2 = 0;
while (i < size) {
if (z) {
arrayMap.put(map.keyAt(i), map.valueAt(i));
} else {
arrayMap.put(map.keyAt(i), null);
}
i++;
i2++;
if (i2 == 999) {
fetchBlock.invoke(arrayMap);
if (!z) {
map.putAll((Map) arrayMap);
}
arrayMap.clear();
i2 = 0;
}
}
if (i2 > 0) {
fetchBlock.invoke(arrayMap);
if (z) {
return;
}
map.putAll((Map) arrayMap);
}
}
}