RussellSpitzer commented on a change in pull request #3530:
URL: https://github.com/apache/iceberg/pull/3530#discussion_r746946857
##########
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()) {
+ return false;
+ }
+
+ return s1.toString().equals(s2.toString());
Review comment:
only need to call "toString" on one of these since String has a
contentsEquals(CharSequence) method
```
boolean | contentEquals(CharSequence cs)Compares this string to the
specified CharSequence.
```
--
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]