include value if keys match exactly

stable-sort
Mike Barry 2022-05-07 05:48:14 -04:00
rodzic 726e6d0107
commit 88efc258ae
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -6,7 +6,11 @@ public record SortableFeature(long key, byte[] value) implements Comparable<Sort
@Override @Override
public int compareTo(SortableFeature o) { public int compareTo(SortableFeature o) {
return Long.compare(key, o.key); int result = Long.compare(key, o.key);
if (result == 0) {
result = Arrays.compare(value, o.value);
}
return result;
} }
@Override @Override