On Sat, 13 Mar 2021 15:18:59 GMT, Claes Redestad <redes...@openjdk.org> wrote:

>> This is a very simple and trivial improvement about getting rid of pointless 
>> char wrapping into array
>
> src/java.base/share/classes/java/io/ObjectStreamClass.java line 833:
> 
>> 831:             String fname = in.readUTF();
>> 832:             String signature = ((tcode == 'L') || (tcode == '[')) ?
>> 833:                 in.readTypeString() : String.valueOf(tcode);
> 
> Since the result of String.valueOf here will be equal to one of the primitive 
> signatures strings ("I", "J", ...) (otherwise ObjectStreamField will throw an 
> exception) it might make sense to turn this into a switch expression and 
> simplify the whole thing. I can't tell how performance sensitive this piece 
> of code is, though.

Hi, I'll check and add one more PR if it makes sense

-------------

PR: https://git.openjdk.java.net/jdk/pull/2660

Reply via email to