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 3f26dc7  GROOVY-8995: Improve the performance of creating list(closes 
#880)
3f26dc7 is described below

commit 3f26dc7b60cc50144a5982d6e70a6a7586594c46
Author: Daniel Sun <sun...@apache.org>
AuthorDate: Wed Feb 20 00:12:17 2019 +0800

    GROOVY-8995: Improve the performance of creating list(closes #880)
---
 src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java 
b/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java
index 1e6781f..64a1ffc 100644
--- a/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java
+++ b/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java
@@ -388,7 +388,11 @@ public class InvokerHelper {
 
     public static List createList(Object[] values) {
         List answer = new ArrayList(values.length);
-        answer.addAll(Arrays.asList(values));
+
+        // GROOVY-8995: Improve the performance of creating list
+        // answer.addAll(Arrays.asList(values));
+        Collections.addAll(answer, values);
+
         return answer;
     }
 

Reply via email to