38 lines
1.3 KiB
Java
38 lines
1.3 KiB
Java
package com.discord.utilities.frecency;
|
|
|
|
import d0.t.u;
|
|
import d0.u.a;
|
|
import d0.z.d.m;
|
|
import java.util.Comparator;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
/* compiled from: FrecencyTracker.kt */
|
|
public final class FrecencyTracker$computeScores$1<T> implements Comparator<T> {
|
|
public final /* synthetic */ HashMap $scores;
|
|
public final /* synthetic */ FrecencyTracker this$0;
|
|
|
|
public FrecencyTracker$computeScores$1(FrecencyTracker frecencyTracker, HashMap hashMap) {
|
|
this.this$0 = frecencyTracker;
|
|
this.$scores = hashMap;
|
|
}
|
|
|
|
@Override // java.util.Comparator
|
|
public final int compare(T t, T t2) {
|
|
int i;
|
|
Integer num = (Integer) this.$scores.get(t);
|
|
Integer num2 = (Integer) this.$scores.get(t2);
|
|
if (!m.areEqual(num, num2)) {
|
|
i = a.compareValues(num, num2);
|
|
} else {
|
|
List list = (List) FrecencyTracker.access$getHistory$p(this.this$0).get(t);
|
|
Long l = null;
|
|
Long l2 = list != null ? (Long) u.last((List<? extends Object>) list) : null;
|
|
List list2 = (List) FrecencyTracker.access$getHistory$p(this.this$0).get(t2);
|
|
if (list2 != null) {
|
|
l = (Long) u.last((List<? extends Object>) list2);
|
|
}
|
|
i = a.compareValues(l2, l);
|
|
}
|
|
return i * -1;
|
|
}
|
|
}
|