RFR: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger

Raffaello Giulietti rgiulietti at openjdk.org
Mon Jun 26 14:24:04 UTC 2023


On Fri, 23 Jun 2023 17:27:00 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

> Please review this PR to use modern APIs and language features to simplify equals, hashCode, and compareTo for BigInteger. If you have any performance concerns, please raise them.
> 
> This PR is cherry-picked from a bigger, not-yet-published PR, to test the waters. That latter PR will be published soon.

src/java.base/share/classes/java/math/BigInteger.java line 1:

> 1: /*

On L.3932, I think you can simplify

        return signum > val.signum ? 1 : -1;

with

        return signum;

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14630#discussion_r1242282379


More information about the core-libs-dev mailing list