mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +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
|
@ -450,8 +450,7 @@ public final class StringBuilder
|
|||
@IntrinsicCandidate
|
||||
public String toString() {
|
||||
// Create a copy, don't share the array
|
||||
return isLatin1() ? StringLatin1.newString(value, 0, count)
|
||||
: StringUTF16.newString(value, 0, count);
|
||||
return new String(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue