dsmiley commented on code in PR #5328:
URL: https://github.com/apache/solr/pull/5328#discussion_r4724395746
##########
solr/core/src/java/org/apache/solr/search/SolrDocumentFetcher.java:
##########
@@ -769,8 +787,66 @@ public Set<String> getNonStoredDVsWithoutCopyTargets() {
return nonStoredDVsWithoutCopyTargets;
}
+ private Set<String> getRawVectorFieldsFrom(ReturnFields returnFields) {
Review Comment:
AFAICT, the return value isn't going to be modified. So you can simply
return `Set.of` for the empty case or `rawVectorsFields` for returnsAllFields
without the HashSet copy. Am I missing something? A simple comment line at
the top of the method would make the no-mutable need more intentional.
It's possible a previous comment by me confused my point. My point is
there's no clarity on mutability needs or lack there-of, and I suggest that you
add some clarity. In general if we can be immutable, that's preferable (i.e.
returning `Set.of` vs `new HashSet()` (that's empty) is better, provided a
mutable one isn't actually needed. For a `getter`, hopefully the caller
doesn't go trying to mutate it.
--
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]