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/10/06 19:47:13 UTC
[groovy] branch GROOVY-8258 updated: GROOVY-8258: use `ArrayList`
instead according to muse-dev's suggestion
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY-8258
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY-8258 by this push:
new a98a8de GROOVY-8258: use `ArrayList` instead according to muse-dev's suggestion
a98a8de is described below
commit a98a8de99e1111b67298dc9d103b1eeffc00ff59
Author: Daniel Sun <su...@apache.org>
AuthorDate: Wed Oct 7 03:46:50 2020 +0800
GROOVY-8258: use `ArrayList` instead according to muse-dev's suggestion
---
.../apache/groovy/linq/provider/collection/QueryableCollection.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/subprojects/groovy-linq/src/main/groovy/org/apache/groovy/linq/provider/collection/QueryableCollection.java b/subprojects/groovy-linq/src/main/groovy/org/apache/groovy/linq/provider/collection/QueryableCollection.java
index 4180afa..c1b8a20 100644
--- a/subprojects/groovy-linq/src/main/groovy/org/apache/groovy/linq/provider/collection/QueryableCollection.java
+++ b/subprojects/groovy-linq/src/main/groovy/org/apache/groovy/linq/provider/collection/QueryableCollection.java
@@ -23,9 +23,9 @@ import groovy.lang.Tuple2;
import groovy.transform.Internal;
import java.math.BigDecimal;
+import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.function.BiPredicate;
import java.util.function.Function;
@@ -214,7 +214,7 @@ class QueryableCollection<T> implements Queryable<T>, Iterable<T> {
.flatMap(p ->
queryable2.stream()
.map(c -> joiner.test(p, c) ? c : null)
- .reduce(new LinkedList<U>(), (r, e) -> {
+ .reduce(new ArrayList<U>(), (r, e) -> {
int size = r.size();
if (0 == size) {
r.add(e);