mirror of https://github.com/apache/lucene.git
SOLR-9195: remove unnecessary allocation and null check in UpdateRequestProcessorChain.getReqProcessors
This commit is contained in:
parent
87016b5f0c
commit
651499c82d
|
@ -76,6 +76,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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue