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:47:30 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X b57212ba3 -> 3eaae0502


Remove unnecessary unboxing

(cherry picked from commit 4886190)


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

Branch: refs/heads/GROOVY_2_5_X
Commit: 3eaae050209d63f01e3192803cd586ef0d3e0800
Parents: b57212b
Author: sunlan <sunlan@apache.org>
Authored: Thu Jul 5 17:46:43 2018 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Thu Jul 5 17:47:26 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/3eaae050/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