You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/04/18 15:51:59 UTC

[groovy] branch master updated: Trivial refactoring: Remove redundant type casting

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 102d076  Trivial refactoring: Remove redundant type casting
102d076 is described below

commit 102d0766f4f177384b2e753707e43d94d40a8631
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Apr 18 23:51:43 2020 +0800

    Trivial refactoring: Remove redundant type casting
---
 src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java b/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java
index 64aedd0..81c9cd5 100644
--- a/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java
+++ b/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java
@@ -287,11 +287,11 @@ public class InvokerHelper {
         }
         if (value instanceof Short) {
             Short number = (Short) value;
-            return (short) -number;
+            return -number;
         }
         if (value instanceof Byte) {
             Byte number = (Byte) value;
-            return (byte) -number;
+            return -number;
         }
         if (value instanceof ArrayList) {
             // value is a list.