8270160: Remove redundant bounds check from AbstractStringBuilder.charAt()
Reviewed-by: redestad
This commit is contained in:
parent
6c4c48faea
commit
2536e4342e
@ -349,9 +349,8 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence {
|
||||
*/
|
||||
@Override
|
||||
public char charAt(int index) {
|
||||
checkIndex(index, count);
|
||||
if (isLatin1()) {
|
||||
return (char)(value[index] & 0xff);
|
||||
return StringLatin1.charAt(value, index);
|
||||
}
|
||||
return StringUTF16.charAt(value, index);
|
||||
}
|
||||
|
@ -27,11 +27,9 @@ package java.lang;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.Spliterator;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.IntConsumer;
|
||||
import java.util.stream.IntStream;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.stream.StreamSupport;
|
||||
import jdk.internal.util.ArraysSupport;
|
||||
|
Loading…
Reference in New Issue
Block a user