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



##########
File path: api/src/main/java/org/apache/iceberg/types/Comparators.java
##########
@@ -187,15 +195,18 @@ private NullsFirst() {
 
     @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:
       The `o1 == o2` case removes the possibility that both are null, so `o2` 
must be non-null here.




-- 
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