Repository: groovy
Updated Branches:
  refs/heads/master 87ff616f7 -> 45448c53b


Trivial refactoring: avoid zero length GenericsType array creation


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

Branch: refs/heads/master
Commit: 45448c53b11a3e238bdf77cc794044b202627607
Parents: 87ff616
Author: danielsun1106 <realblue...@hotmail.com>
Authored: Tue Feb 20 03:15:32 2018 +0800
Committer: danielsun1106 <realblue...@hotmail.com>
Committed: Tue Feb 20 03:15:32 2018 +0800

----------------------------------------------------------------------
 src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/45448c53/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java 
b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
index 642f90c..126ef42 100644
--- a/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
+++ b/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java
@@ -57,7 +57,7 @@ import static 
org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.implem
  * @author Paul King
  */
 public class GenericsUtils {
-    public static final GenericsType[] EMPTY_GENERICS_ARRAY = new 
GenericsType[0];
+    public static final GenericsType[] EMPTY_GENERICS_ARRAY = 
GenericsType.EMPTY_ARRAY;
     public static final String JAVA_LANG_OBJECT = "java.lang.Object";
 
     /**
@@ -274,7 +274,7 @@ public class GenericsUtils {
         if (type.isArray()) {
             return makeClassSafeWithGenerics(type.getComponentType(), 
genericTypes).makeArray();
         }
-        GenericsType[] gtypes = new GenericsType[0];
+        GenericsType[] gtypes = GenericsType.EMPTY_ARRAY;
         if (genericTypes != null) {
             gtypes = new GenericsType[genericTypes.length];
             System.arraycopy(genericTypes, 0, gtypes, 0, gtypes.length);

Reply via email to