Compare hit scores correctly
[Sone.git] / src / main / java / net / pterodactylus / sone / web / SearchPage.java
index 7ec7f9f..39912d2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - SearchPage.java - Copyright © 2010–2015 David Roden
+ * Sone - SearchPage.java - Copyright © 2010–2016 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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());
                        }
 
                };