RFR: JDK-8297731: Remove redundant check in MutableBigInteger.divide

Sergey Bylokhov serb at openjdk.org
Mon Nov 28 19:58:43 UTC 2022


On Mon, 28 Nov 2022 19:49:55 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Remove redundant code reported in
>> 
>> https://mail.openjdk.org/pipermail/core-libs-dev/2022-November/097163.html
>
> src/java.base/share/classes/java/math/MutableBigInteger.java line 1536:
> 
>> 1534: 
>> 1535:         // Must insert leading 0 in rem if its length did not change
>> 1536:         if (rem.intLen == nlen) {
> 
> Looks like after this change the local nlen variable is used only once, and probably can be removed?

BTW the "rem.leftShift(shift);" above may change the "rem.intLen" value, no?

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

PR: https://git.openjdk.org/jdk/pull/11395


More information about the core-libs-dev mailing list