RussellSpitzer commented on a change in pull request #3530:
URL: https://github.com/apache/iceberg/pull/3530#discussion_r746949492



##########
File path: core/src/main/java/org/apache/iceberg/deletes/Deletes.java
##########
@@ -261,7 +258,20 @@ public void close() {
 
     @Override
     protected boolean shouldKeep(T posDelete) {
-      return CHARSEQ_COMPARATOR.compare(dataLocation, (CharSequence) 
FILENAME_ACCESSOR.get(posDelete)) == 0;
+      return charSeqEquals(dataLocation, (CharSequence) 
FILENAME_ACCESSOR.get(posDelete));
+    }
+
+    private boolean charSeqEquals(CharSequence s1, CharSequence s2) {
+      if (s1 == s2) {
+        return true;
+      }
+
+      int count = s1.length();
+      if (count != s2.length()) {

Review comment:
       also you could group all these a bit
   
   return s1 == s2 || (s1.length() == s2.length() && 
s1.toString().contentEquals(s2));
   
   Although I'd be surprised if the length check wasn't the first thing checked 
in the contentEquals method so you may be able to skip that. Benchmark would 
help




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