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



##########
File path: core/src/main/java/org/apache/iceberg/deletes/Deletes.java
##########
@@ -261,7 +258,11 @@ 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) {
+      return s1 == s2 || (s1.length() == s2.length() && 
s1.toString().contentEquals(s2));

Review comment:
       Made the change. My test shows the hash code works faster when it 
compares two different strings with the same length.




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