Simplifies the version comparator a bit
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good

This commit is contained in:
Kristian Knarvik 2021-08-03 12:23:59 +02:00
parent 73faa4408e
commit dc362eb2c8

View File

@ -90,10 +90,8 @@ public final class Updater {
for (int i = 0; i < Math.max(oldVersionParts.length, newVersionParts.length); i++) {
int oldVersionNumber = oldVersionParts.length > i ? Integer.parseInt(oldVersionParts[i]) : 0;
int newVersionNumber = newVersionParts.length > i ? Integer.parseInt(newVersionParts[i]) : 0;
if (newVersionNumber > oldVersionNumber) {
return true;
} else if (newVersionNumber < oldVersionNumber) {
return false;
if (newVersionNumber != oldVersionNumber) {
return newVersionNumber > oldVersionNumber;
}
}
return false;