rdblue commented on a change in pull request #3152:
URL: https://github.com/apache/iceberg/pull/3152#discussion_r711799053



##########
File path: api/src/main/java/org/apache/iceberg/types/Comparators.java
##########
@@ -212,15 +223,18 @@ private NullsLast() {
 
     @Override
     public int compare(T o1, T o2) {
+      if (o1 == o2) {
+        return 0;
+      }
+
       if (o1 != null) {
         if (o2 != null) {
           return 0;
         }
         return -1;
-      } else if (o2 != null) {
-        return 1;
       }
-      return 0;
+
+      return 1;

Review comment:
       Like above, the `o1 == o2` case removes the possibility that `o2` is 
null. Otherwise, it would be equal to `o1`.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to