jainankitk commented on code in PR #14474:
URL: https://github.com/apache/lucene/pull/14474#discussion_r2038470766


##########
lucene/core/src/java/org/apache/lucene/geo/ComponentTree.java:
##########
@@ -322,27 +317,7 @@ private static ComponentTree createTree(
     }
     final int mid = (low + high) >>> 1;
     if (low < high) {
-      Comparator<Component2D> comparator;
-      if (splitX) {
-        comparator =
-            (left, right) -> {
-              int ret = Double.compare(left.getMinX(), right.getMinX());
-              if (ret == 0) {
-                ret = Double.compare(left.getMaxX(), right.getMaxX());
-              }
-              return ret;
-            };
-      } else {
-        comparator =
-            (left, right) -> {
-              int ret = Double.compare(left.getMinY(), right.getMinY());
-              if (ret == 0) {
-                ret = Double.compare(left.getMaxY(), right.getMaxY());
-              }
-              return ret;
-            };
-      }
-      ArrayUtil.select(components, low, high + 1, mid, comparator);
+      ArrayUtil.select(components, low, high + 1, mid, splitX ? XComparator : 
YComparator);

Review Comment:
   I noticed 1/2 places where we have used Ternary operators. But, not 
something I am too particular about. Added `if-else` back



-- 
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-unsubscr...@lucene.apache.org

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


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

Reply via email to