8299807: newStringNoRepl should avoid copying arrays for ASCII compatible charsets

Reviewed-by: rriggs
This commit is contained in:
Glavo 2023-03-03 15:41:03 +00:00 committed by Roger Riggs
parent c6de66c03f
commit 7449e1c661
2 changed files with 16 additions and 5 deletions

View file

@ -2478,7 +2478,7 @@ public final class System {
}
public String newStringUTF8NoRepl(byte[] bytes, int off, int len) {
return String.newStringUTF8NoRepl(bytes, off, len);
return String.newStringUTF8NoRepl(bytes, off, len, true);
}
public byte[] getBytesUTF8NoRepl(String s) {