From: David ‘Bombe’ Roden Date: Thu, 20 Oct 2016 09:04:16 +0000 (+0200) Subject: Compare hit scores correctly X-Git-Tag: 0.9.6^2~10 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=84dfabd1990656fe4ee039ef4b532db44dfef431;p=Sone.git Compare hit scores correctly --- diff --git a/src/main/java/net/pterodactylus/sone/web/SearchPage.java b/src/main/java/net/pterodactylus/sone/web/SearchPage.java index 5b657d5..39912d2 100644 --- a/src/main/java/net/pterodactylus/sone/web/SearchPage.java +++ b/src/main/java/net/pterodactylus/sone/web/SearchPage.java @@ -593,7 +593,7 @@ public class SearchPage extends SoneTemplatePage { @Override public int compare(Hit leftHit, Hit rightHit) { - return (rightHit.getScore() < leftHit.getScore()) ? -1 : ((rightHit.getScore() > leftHit.getScore()) ? 1 : 0); + return Double.compare(rightHit.getScore(), leftHit.getScore()); } };