On Fri, 13 Oct 2023 17:01:11 GMT, Shaojin Wen <d...@openjdk.org> wrote:

>> I submitted PR #15555 before, and there were too many changes. I split it 
>> into multiple PRs with small changes. This one is one of them.
>> 
>> this PR removed the duplicate code for getChars in 
>> BigDecimal#StringBuilderHelper, i also make performance faster.
>> Please review and don't hesitate to critique my approach and patch.
>
> Shaojin Wen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   use % calculate lowInt

Core-libs has duplicate codes for stringSize and getChars in many places, such 
as:

* java.math.BigDecimal$StringBuilderHelper
* jdk.util.DecimalDigits
* java.time.format.DateTimeFormatterBuilder$NanosPrinterParser

We have two options to reduce duplicate code:
1. Provide the stringSize method of Integer/Long and the getChars method of 
StringLatin1/StringUTF168 through JLA.
2. Move the stringSize method of Integer/Long and the getChars method of 
StringLatin1/StringUTF168 to jdk.util.DecimalDigits (PR #15699 )

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

PR Comment: https://git.openjdk.org/jdk/pull/16006#issuecomment-1762634035

Reply via email to