<i18n dev> RFR: 8337279: Optimize format instant

Shaojin Wen duke at openjdk.org
Fri Jul 26 15:34:34 UTC 2024


On Fri, 26 Jul 2024 15:24:46 GMT, Stephen Colebourne <scolebourne at openjdk.org> wrote:

>> By removing the redundant code logic in DateTimeFormatterBuilder$InstantPrinterParser#formatTo, the codeSize can be reduced and the performance can be improved.
>
> src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 3818:
> 
>> 3816:             }
>> 3817:             // add fraction
>> 3818:             if (fractionalDigits > 0) {
> 
> This breaks the logic. `fractionalDigits` can be negative in the block below

If fractionalDigits < 0, printNano is implemented in LocalDateTime

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20353#discussion_r1693263366


More information about the i18n-dev mailing list