Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-970: Use an ArrayList since we know exactly how long the List will be in advance

Chris M. Hostetter68b72fc830f0
diff --git a/CHANGES.txt b/CHANGES.txt
index ad24afd2860..0eb2590f5a9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -154,6 +154,9 @@ Optimizations
Controllable via the facet.method parameter - "fc" is the new default method and "enum"
is the original method. (yonik)
+ 4. SOLR-970: Use an ArrayList in SolrPluginUtils.parseQueryStrings
+ since we know exactly how long the List will be in advance.
+ (Kay Kay via hossman)
Bug Fixes
----------------------
diff --git a/src/java/org/apache/solr/util/SolrPluginUtils.java b/src/java/org/apache/solr/util/SolrPluginUtils.java
index 9d15f1cc2fd..22ac813559e 100644
--- a/src/java/org/apache/solr/util/SolrPluginUtils.java
+++ b/src/java/org/apache/solr/util/SolrPluginUtils.java
@@ -848,7 +848,7 @@ public class SolrPluginUtils {
public static List<Query> parseQueryStrings(SolrQueryRequest req,
String[] queries) throws ParseException {
if (null == queries || 0 == queries.length) return null;
- List<Query> out = new LinkedList<Query>();
+ List<Query> out = new ArrayList<Query>(queries.length);
for (String q : queries) {
if (null != q && 0 != q.trim().length()) {
out.add(QParser.getParser(q, null, req).getQuery());