Skip to content

Commit

Permalink
If objects are equal sort shouldn't matter
Browse files Browse the repository at this point in the history
  • Loading branch information
aless2003 committed Jul 9, 2024
1 parent b6a0c13 commit 5c93aa7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package online.hatsunemiku.tachideskvaadinui.data.tachidesk;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand Down Expand Up @@ -84,6 +85,10 @@ public String toString() {
*/
@Override
public int compareTo(@NotNull Chapter o) {
if (Objects.equals(this, o)) {
return 0;
}

return Float.compare(chapterNumber, o.chapterNumber);
}
}

0 comments on commit 5c93aa7

Please sign in to comment.