You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2019/08/20 05:51:20 UTC

[GitHub] [groovy] paulk-asert commented on a change in pull request #996: Fix potential bugs

paulk-asert commented on a change in pull request #996: Fix potential bugs
URL: https://github.com/apache/groovy/pull/996#discussion_r315515350
 
 

 ##########
 File path: src/main/java/groovy/lang/ObjectRange.java
 ##########
 @@ -302,7 +302,7 @@ public int size() {
                 // let's fast calculate the size
                 final BigDecimal fromNum = new BigDecimal(from.toString());
                 final BigDecimal toNum = new BigDecimal(to.toString());
-                final BigInteger sizeNum = toNum.subtract(fromNum).add(new BigDecimal(1.0)).toBigInteger();
+                final BigInteger sizeNum = toNum.subtract(fromNum).add(BigDecimal.valueOf(1.0)).toBigInteger();
 
 Review comment:
   We can probably just use: BigDecimal.ONE these days.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services