Use Integer.compare() instead of if statements.

This commit is contained in:
MattBDev 2020-06-11 17:25:30 -04:00
parent 9ce4a415cb
commit 8a5899459f

View File

@ -31,13 +31,7 @@ public class TaskStateComparator implements Comparator<Task<?>> {
public int compare(com.sk89q.worldedit.util.task.Task<?> o1, Task<?> o2) { public int compare(com.sk89q.worldedit.util.task.Task<?> o1, Task<?> o2) {
int ordinal1 = o1.getState().ordinal(); int ordinal1 = o1.getState().ordinal();
int ordinal2 = o2.getState().ordinal(); int ordinal2 = o2.getState().ordinal();
if (ordinal1 < ordinal2) { return Integer.compare(ordinal1, ordinal2);
return -1;
} else if (ordinal1 > ordinal2) {
return 1;
} else {
return 0;
}
} }
} }