groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Remove unnecessary unboxing
Date Thu, 05 Jul 2018 09:46:56 GMT
Repository: groovy
Updated Branches:
  refs/heads/master bb9b874a8 -> 488619017


Remove unnecessary unboxing


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/48861901
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/48861901
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/48861901

Branch: refs/heads/master
Commit: 488619017c58c05a07d7a293f734c0ba2c171ed0
Parents: bb9b874
Author: sunlan <sunlan@apache.org>
Authored: Thu Jul 5 17:46:43 2018 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Thu Jul 5 17:46:43 2018 +0800

----------------------------------------------------------------------
 .../org/codehaus/groovy/runtime/dgmimpl/NumberNumberDiv.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/48861901/src/main/java/org/codehaus/groovy/runtime/dgmimpl/NumberNumberDiv.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/runtime/dgmimpl/NumberNumberDiv.java b/src/main/java/org/codehaus/groovy/runtime/dgmimpl/NumberNumberDiv.java
index 443d970..f49fa78 100644
--- a/src/main/java/org/codehaus/groovy/runtime/dgmimpl/NumberNumberDiv.java
+++ b/src/main/java/org/codehaus/groovy/runtime/dgmimpl/NumberNumberDiv.java
@@ -140,7 +140,7 @@ public final class NumberNumberDiv extends NumberNumberMetaMethod {
         public final Object call(Object receiver, Object arg) throws Throwable {
             try {
                 if (checkCall(receiver, arg)) {
-                    return ((Integer) receiver).intValue() / ((Double) arg).doubleValue();
+                    return (Integer) receiver / (Double) arg;
                 }
             }
             catch (ClassCastException e) {//
@@ -174,7 +174,7 @@ public final class NumberNumberDiv extends NumberNumberMetaMethod {
         public final Object call(Object receiver, Object arg) throws Throwable {
             try {
                 if (checkCall(receiver, arg)) {
-                    return ((Long) receiver).doubleValue() / ((Double) arg).doubleValue();
+                    return ((Long) receiver).doubleValue() / (Double) arg;
                 }
             }
             catch (ClassCastException e) {//


Mime
View raw message