You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/12/24 21:25:35 UTC

[GitHub] [lucene] ErikPelli commented on a diff in pull request #12036: Remove redundant code in Lucene geo

ErikPelli commented on code in PR #12036:
URL: https://github.com/apache/lucene/pull/12036#discussion_r1056874550


##########
lucene/core/src/java/org/apache/lucene/geo/GeoUtils.java:
##########
@@ -205,13 +205,7 @@ static boolean within90LonDegrees(double lon, double minLon, double maxLon) {
   public static int orient(double ax, double ay, double bx, double by, double cx, double cy) {
     double v1 = (bx - ax) * (cy - ay);
     double v2 = (cx - ax) * (by - ay);
-    if (v1 > v2) {
-      return 1;
-    } else if (v1 < v2) {
-      return -1;
-    } else {
-      return 0;
-    }
+    return Double.compare(v1, v2);

Review Comment:
   Mmmm ok, if the arguments will not be NaN in any case, that makes sense to be reverted (even if the difference would be negligible)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org