On Thu, 15 May 2025 22:43:54 GMT, Shaojin Wen <s...@openjdk.org> wrote:

>> fabioromano1 has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   make magBitLength() an instance method
>
> src/java.base/share/classes/java/math/BigInteger.java line 3860:
> 
>> 3858:                 && Integer.lowestOneBit(mag[0]) == mag[0]
>> 3859:                 && numberOfTrailingZeroInts() == mag.length - 1
>> 3860:             ? magBitLength() - 1 : magBitLength();
> 
> Suggestion:
> 
>         int[] mag = this.mag;
>         return magBitLength() 
>                 - (signum < 0
>                    // Check if magnitude is a power of two
>                    && Integer.lowestOneBit(mag[0]) == mag[0]
>                    && numberOfTrailingZeroInts() == mag.length - 1
>                    ? 1 : 0);
> 
> 
> In this way, codeSize will drop from 52 to 45

What is the usefulness of doing `int[] mag = this.mag;` at line 3856?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25166#discussion_r2093057326

Reply via email to