48 lines
1.9 KiB
Java
48 lines
1.9 KiB
Java
|
package com.discord.stores;
|
||
|
|
||
|
import com.discord.api.channel.Channel;
|
||
|
import d0.t.g0;
|
||
|
import d0.t.o;
|
||
|
import j0.k.b;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Collection;
|
||
|
import java.util.LinkedHashMap;
|
||
|
import java.util.List;
|
||
|
import java.util.Map;
|
||
|
/* compiled from: StoreChannels.kt */
|
||
|
public final class StoreChannels$observeIds$1<T, R> implements b<Map<Long, ? extends Channel>, Map<Long, ? extends List<? extends Long>>> {
|
||
|
public static final StoreChannels$observeIds$1 INSTANCE = new StoreChannels$observeIds$1();
|
||
|
|
||
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
||
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
||
|
@Override // j0.k.b
|
||
|
public /* bridge */ /* synthetic */ Map<Long, ? extends List<? extends Long>> call(Map<Long, ? extends Channel> map) {
|
||
|
return call((Map<Long, Channel>) map);
|
||
|
}
|
||
|
|
||
|
public final Map<Long, List<Long>> call(Map<Long, Channel> map) {
|
||
|
Collection<Channel> values = map.values();
|
||
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
||
|
for (T t : values) {
|
||
|
Long valueOf = Long.valueOf(t.e());
|
||
|
Object obj = linkedHashMap.get(valueOf);
|
||
|
if (obj == null) {
|
||
|
obj = new ArrayList();
|
||
|
linkedHashMap.put(valueOf, obj);
|
||
|
}
|
||
|
((List) obj).add(t);
|
||
|
}
|
||
|
LinkedHashMap linkedHashMap2 = new LinkedHashMap(g0.mapCapacity(linkedHashMap.size()));
|
||
|
for (T t2 : linkedHashMap.entrySet()) {
|
||
|
Object key = t2.getKey();
|
||
|
List<T> list = (List) t2.getValue();
|
||
|
ArrayList arrayList = new ArrayList(o.collectionSizeOrDefault(list, 10));
|
||
|
for (T t3 : list) {
|
||
|
arrayList.add(Long.valueOf(t3.g()));
|
||
|
}
|
||
|
linkedHashMap2.put(key, arrayList);
|
||
|
}
|
||
|
return linkedHashMap2;
|
||
|
}
|
||
|
}
|