You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by mk...@apache.org on 2023/01/23 19:06:55 UTC

[solr] branch branch_9x updated: Apache 9x (#1308)

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

mkhl pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 97e48ab46e6 Apache 9x (#1308)
97e48ab46e6 is described below

commit 97e48ab46e6b5ede3be13d8e9e06b776db0d298f
Author: Renato Haeberli <re...@onnet.ch>
AuthorDate: Tue Jan 24 06:06:49 2023 +1100

    Apache 9x (#1308)
    
    * setting initial length for facetQueries ArrayList
    
    * Using isNotEmpty-method rather than negating isEmpty
    
    Co-authored-by: Renato Haeberli <>
---
 .../src/java/org/apache/solr/handler/component/FacetComponent.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java
index 141389f4e63..9d46b773ec9 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java
@@ -163,7 +163,7 @@ public class FacetComponent extends SearchComponent {
 
       String[] queries = rb.req.getParams().getParams(FacetParams.FACET_QUERY);
       if (queries != null) {
-        facetQueries = new ArrayList<>();
+        facetQueries = new ArrayList<>(queries.length);
         for (String query : queries) {
           facetQueries.add(new FacetBase(rb, FacetParams.FACET_QUERY, query));
         }
@@ -277,7 +277,7 @@ public class FacetComponent extends SearchComponent {
 
       NamedList<Object> counts = FacetComponent.getFacetCounts(f, fdebug);
       String[] pivots = params.getParams(FacetParams.FACET_PIVOT);
-      if (!ArrayUtils.isEmpty(pivots)) {
+      if (ArrayUtils.isNotEmpty(pivots)) {
         PivotFacetProcessor pivotProcessor =
             new PivotFacetProcessor(rb.req, rb.getResults().docSet, params, rb);
         SimpleOrderedMap<List<NamedList<Object>>> v = pivotProcessor.process(pivots);