discord-jadx/app/src/main/java/com/discord/stores/StoreGuildsSorted$updatePos...

47 lines
1.6 KiB
Java

package com.discord.stores;
import com.discord.models.guild.Guild;
import com.discord.stores.StoreGuildsSorted;
import d0.g0.t;
import java.util.Comparator;
import java.util.Map;
/* compiled from: StoreGuildsSorted.kt */
public final class StoreGuildsSorted$updatePositions$1<T> implements Comparator<Long> {
public final /* synthetic */ Map $guilds;
public final /* synthetic */ StoreGuildsSorted.State $state;
public StoreGuildsSorted$updatePositions$1(StoreGuildsSorted.State state, Map map) {
this.$state = state;
this.$guilds = map;
}
public final int compare(Long l, Long l2) {
String str;
String name;
boolean contains = this.$state.getMutedGuilds().contains(l);
if (this.$state.getMutedGuilds().contains(l2) != contains) {
return contains ? 1 : -1;
}
Long l3 = this.$state.getJoinedAt().get(l);
long j = Long.MIN_VALUE;
long longValue = l3 != null ? l3.longValue() : Long.MIN_VALUE;
Long l4 = this.$state.getJoinedAt().get(l);
if (l4 != null) {
j = l4.longValue();
}
if (longValue != j) {
return (int) (longValue - j);
}
Guild guild = (Guild) this.$guilds.get(l);
String str2 = "";
if (guild == null || (str = guild.getName()) == null) {
str = str2;
}
Guild guild2 = (Guild) this.$guilds.get(l2);
if (!(guild2 == null || (name = guild2.getName()) == null)) {
str2 = name;
}
return t.compareTo(str, str2, false);
}
}