This commit is contained in:
Jesper Wilhelmsson 2022-01-20 01:18:38 +00:00
commit 4616c13c2f
67 changed files with 1126 additions and 799 deletions

View file

@ -3440,8 +3440,8 @@ loop: for(int x=0, offset=0; x<nCodePoints; x++, offset+=len) {
private static final int countChars(CharSequence seq, int index,
int lengthInCodePoints) {
// optimization
if (lengthInCodePoints == 1 && !Character.isHighSurrogate(seq.charAt(index))) {
assert (index >= 0 && index < seq.length());
if (lengthInCodePoints == 1 && index >= 0 && index < seq.length() &&
!Character.isHighSurrogate(seq.charAt(index))) {
return 1;
}
int length = seq.length();