mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +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
|
@ -712,9 +712,7 @@ import jdk.internal.vm.annotation.IntrinsicCandidate;
|
|||
@IntrinsicCandidate
|
||||
public synchronized String toString() {
|
||||
if (toStringCache == null) {
|
||||
return toStringCache =
|
||||
isLatin1() ? StringLatin1.newString(value, 0, count)
|
||||
: StringUTF16.newString(value, 0, count);
|
||||
return toStringCache = new String(this, null);
|
||||
}
|
||||
return new String(toStringCache);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue