mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8282429: StringBuilder/StringBuffer.toString() skip compressing for UTF16 strings
Reviewed-by: djelinski, redestad
This commit is contained in:
parent
8eff80682a
commit
bab431cc12
6 changed files with 122 additions and 11 deletions
|
@ -4521,7 +4521,8 @@ public final class String
|
|||
this.coder = LATIN1;
|
||||
this.value = Arrays.copyOfRange(val, 0, length);
|
||||
} else {
|
||||
if (COMPACT_STRINGS) {
|
||||
// only try to compress val if some characters were deleted.
|
||||
if (COMPACT_STRINGS && asb.maybeLatin1) {
|
||||
byte[] buf = StringUTF16.compress(val, 0, length);
|
||||
if (buf != null) {
|
||||
this.coder = LATIN1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue