JavaMoney / jsr354-ri

JSR 354 - Moneta: Reference Implementation
Other
344 stars 101 forks source link

Remove getNumberStripped call from Money.equals #258

Closed marschall closed 5 years ago

marschall commented 5 years ago

Money.equals currently calls getNumberStripped on the receiver and the argument to compare two BigDecimals for equality. This ends up calling stripTrailingZeros for both BigDecimals. The same can be achieved without allocations using BigDecimal.compareTo.


This change is Reviewable