On Thu, 13 Nov 2025 16:40:45 GMT, Johannes Döbler <[email protected]> wrote:

>> Shaojin Wen has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   add comments
>
> src/java.base/share/classes/java/time/MonthDay.java line 758:
> 
>> 756:         buf.append('-');
>> 757:         DecimalDigits.appendPair(buf, day);
>> 758:         return buf.toString();
> 
> Why not
> 
>     byte[] bytes = new byte[7];
>       bytes[0] = (byte)'-';
>       bytes[1] = (byte)'-';
>       DecimalDigits.appendPair(bytes, 2, month); // TBD
>       bytes[4] = (byte)'-';
>       DecimalDigits.appendPair(bytes, 5, month);
>       return JLA.uncheckedNewStringWithLatin1Bytes(bytes);

That's a good suggestion, but such optimization is irrelevant to this PR, or it 
should be done in a separate PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26911#discussion_r2527645555

Reply via email to