stillalex commented on code in PR #1107:
URL: https://github.com/apache/solr/pull/1107#discussion_r1038361120
##########
solr/core/src/java/org/apache/solr/search/QueryResultKey.java:
##########
@@ -51,20 +52,28 @@ public QueryResultKey(
Query query, List<Query> filters, Sort sort, int nc_flags, int
minExactCount) {
this.query = query;
this.sort = sort;
- this.filters = filters;
this.nc_flags = nc_flags;
this.minExactCount = minExactCount;
int h = query.hashCode();
- if (filters != null) {
- for (Query filt : filters)
+ if (filters == null) {
+ this.filters = null;
+ } else {
+ this.filters =
filters.stream().filter(Objects::nonNull).collect(Collectors.toList());
Review Comment:
suggestion. what about using `Collectors.toUnmodifiableList()`, and same for
the one below
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]