mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-02 15:20:27 +00:00
8365887: Outdated comments in String::decode
Reviewed-by: liach, sherman
This commit is contained in:
parent
60e4b91f61
commit
38ee41bee3
@ -671,14 +671,6 @@ public final class String
|
||||
}
|
||||
|
||||
private static String decode(Charset charset, byte[] bytes, int offset, int length) {
|
||||
// (1)We never cache the "external" cs, the only benefit of creating
|
||||
// an additional StringDe/Encoder object to wrap it is to share the
|
||||
// de/encode() method. These SD/E objects are short-lived, the young-gen
|
||||
// gc should be able to take care of them well. But the best approach
|
||||
// is still not to generate them if not really necessary.
|
||||
// (2)The defensive copy of the input byte/char[] has a big performance
|
||||
// impact, as well as the outgoing result byte/char[]. Need to do the
|
||||
// optimization check of (sm==null && classLoader0==null) for both.
|
||||
CharsetDecoder cd = charset.newDecoder();
|
||||
// ArrayDecoder fastpaths
|
||||
if (cd instanceof ArrayDecoder ad) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user