2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.guilds;
|
|
|
|
|
|
|
|
import com.discord.models.guild.Guild;
|
|
|
|
import com.discord.widgets.guilds.WidgetGuildSelector;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.t.n;
|
|
|
|
import d0.t.o;
|
|
|
|
import d0.t.u;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import j0.k.b;
|
2021-08-03 07:33:18 +00:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
import java.util.List;
|
|
|
|
/* compiled from: WidgetGuildSelector.kt */
|
|
|
|
public final class WidgetGuildSelector$get$1<T, R> implements b<LinkedHashMap<Long, Guild>, List<? extends WidgetGuildSelector.Item>> {
|
|
|
|
public final /* synthetic */ WidgetGuildSelector.FilterFunction $filterFunction;
|
|
|
|
public final /* synthetic */ boolean $includeNoGuild;
|
|
|
|
|
|
|
|
public WidgetGuildSelector$get$1(WidgetGuildSelector.FilterFunction filterFunction, boolean z2) {
|
|
|
|
this.$filterFunction = filterFunction;
|
|
|
|
this.$includeNoGuild = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final List<WidgetGuildSelector.Item> call(LinkedHashMap<Long, Guild> linkedHashMap) {
|
|
|
|
Collection<Guild> values = linkedHashMap.values();
|
|
|
|
m.checkNotNullExpressionValue(values, "guilds.values");
|
|
|
|
WidgetGuildSelector.FilterFunction filterFunction = this.$filterFunction;
|
|
|
|
ArrayList<T> arrayList = new ArrayList();
|
|
|
|
for (T t : values) {
|
|
|
|
if (filterFunction.includeGuild(t)) {
|
|
|
|
arrayList.add(t);
|
|
|
|
}
|
|
|
|
}
|
2021-11-02 06:38:17 +00:00
|
|
|
List listOf = this.$includeNoGuild ? d0.t.m.listOf(new WidgetGuildSelector.Item(null)) : n.emptyList();
|
2021-08-03 07:33:18 +00:00
|
|
|
ArrayList arrayList2 = new ArrayList(o.collectionSizeOrDefault(arrayList, 10));
|
|
|
|
for (T t2 : arrayList) {
|
|
|
|
arrayList2.add(new WidgetGuildSelector.Item(t2));
|
|
|
|
}
|
|
|
|
return u.plus((Collection) listOf, (Iterable) arrayList2);
|
|
|
|
}
|
|
|
|
}
|