lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject lucene-solr:branch_6x: SOLR-9195: remove unnecessary allocation and null check in UpdateRequestProcessorChain.getReqProcessors
Date Wed, 15 Jun 2016 15:44:04 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 62452f033 -> f9521549e


SOLR-9195: remove unnecessary allocation and null check in UpdateRequestProcessorChain.getReqProcessors


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f9521549
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f9521549
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f9521549

Branch: refs/heads/branch_6x
Commit: f9521549e0dc45c9298dfbebb59b5aaef21e1670
Parents: 62452f0
Author: Christine Poerschke <cpoerschke@apache.org>
Authored: Wed Jun 15 12:11:02 2016 +0100
Committer: Christine Poerschke <cpoerschke@apache.org>
Committed: Wed Jun 15 14:39:45 2016 +0100

----------------------------------------------------------------------
 solr/CHANGES.txt                                 |  6 ++++++
 .../processor/UpdateRequestProcessorChain.java   | 19 ++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f9521549/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 3f7c523..00b280d 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -47,6 +47,12 @@ Bug Fixes
 * SOLR-9161: Change SolrPluginUtils.invokeSetters implementation to accommodate setter variants.
   (Christine Poerschke, Steve Rowe, Uwe Schindler)
 
+Other Changes
+----------------------
+
+* SOLR-9195: Remove unnecessary allocation and null check in UpdateRequestProcessorChain's
+  getReqProcessors method. (Christine Poerschke)
+
 ==================  6.1.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f9521549/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
b/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
index 5efcb95..bd23b4b 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/UpdateRequestProcessorChain.java
@@ -265,17 +265,14 @@ public final class UpdateRequestProcessorChain implements PluginInfoInitialized
   static List<UpdateRequestProcessorFactory> getReqProcessors(String processor, SolrCore
core) {
     if (processor == null) return Collections.EMPTY_LIST;
     List<UpdateRequestProcessorFactory> result = new ArrayList<>();
-    if (processor != null) {
-      List<String> names = StrUtils.splitSmart(processor, ',');
-      List<UpdateRequestProcessorFactory> l = new ArrayList<>(names.size());
-      for (String s : names) {
-        s = s.trim();
-        if (s.isEmpty()) continue;
-        UpdateRequestProcessorFactory p = core.getUpdateProcessors().get(s);
-        if (p == null)
-          throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "No such processor
" + s);
-        result.add(p);
-      }
+    List<String> names = StrUtils.splitSmart(processor, ',');
+    for (String s : names) {
+      s = s.trim();
+      if (s.isEmpty()) continue;
+      UpdateRequestProcessorFactory p = core.getUpdateProcessors().get(s);
+      if (p == null)
+        throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "No such processor "
+ s);
+      result.add(p);
     }
     return result;
   }


Mime
View raw message