Skip to content

Commit

Permalink
[StringUtils:indexOfAnyBut] remove comment
Browse files Browse the repository at this point in the history
Set::contains of immutable Set has unclear desastrous performance issues
when searching for large values (here: >0xffff) in a set of smaller
values (including JDK 23)
  • Loading branch information
IBue committed Jan 6, 2025
1 parent b585112 commit 915ee33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/apache/commons/lang3/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2856,7 +2856,7 @@ public static int indexOfAnyBut(final CharSequence seq, final CharSequence searc
return INDEX_NOT_FOUND;
}
final Set<Integer> searchSetCodePoints = searchChars.codePoints()
.boxed().collect(Collectors.toSet()); // JDK >=10: Collectors::toUnmodifiableSet
.boxed().collect(Collectors.toSet());
// advance character index from one interpreted codepoint to the next
for (int curSeqCharIdx = 0; curSeqCharIdx < seq.length();) {
final int curSeqCodePoint = Character.codePointAt(seq, curSeqCharIdx);
Expand Down

0 comments on commit 915ee33

Please sign in to comment.