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 2020/03/22 16:58:10 UTC

[GitHub] [groovy] PascalSchumacher commented on a change in pull request #1199: Avoid unnecessary boxing and unbox of primitive values.

PascalSchumacher commented on a change in pull request #1199: Avoid unnecessary boxing and unbox of primitive values.
URL: https://github.com/apache/groovy/pull/1199#discussion_r396116338
 
 

 ##########
 File path: src/main/java/org/codehaus/groovy/runtime/typehandling/DefaultTypeTransformation.java
 ##########
 @@ -299,12 +299,12 @@ private static Object continueCastOnNumber(Object object, Class type) {
                 return n.floatValue();
             }
             if (type == Double.class) {
-                Double answer = n.doubleValue();
+                double answer = n.doubleValue();
 
 Review comment:
   The `INFINITY` comparisons can be done without boxing/unboxing.

----------------------------------------------------------------
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