JDK 9 RFR of 6375303: Review use of caching in BigDecimal
Brian Burkhalter
brian.burkhalter at oracle.com
Mon Mar 24 17:44:00 UTC 2014
Hi Peter,
On Mar 22, 2014, at 2:01 AM, Peter Levart <peter.levart at gmail.com> wrote:
> Looks good. Just a nit. In the following method:
>
> 3726 private static void matchScale(BigDecimal[] val) {
I concur.
> One of 3 ifs is superfluous. Either the 1st one:
>
> private static void matchScale(BigDecimal[] val) {
> /* if (val[0].scale == val[1].scale) {
> // return
> } else */ if (val[0].scale < val[1].scale) {
> val[0] = val[0].setScale(val[1].scale, ROUND_UNNECESSARY);
> } else if (val[1].scale < val[0].scale) {
> val[1] = val[1].setScale(val[0].scale, ROUND_UNNECESSARY);
> }
> }
I think this one. I’ll update the patch accordingly.
Thanks,
Brian
More information about the core-libs-dev
mailing list