serhiy-bzhezytskyy commented on code in PR #4760:
URL: https://github.com/apache/solr/pull/4760#discussion_r3821907683


##########
solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java:
##########
@@ -400,13 +401,9 @@ public Iterator<Slice> iterator() {
     return slices.values().iterator();
   }
 
-  @Deprecated // low usage and builds an ArrayList (surprising)
-  public List<Replica> getReplicas() {
-    List<Replica> replicas = new ArrayList<>();
-    for (Slice slice : this) {
-      replicas.addAll(slice.getReplicas());
-    }
-    return replicas;
+  /** Stream of all replicas across all slices, without allocating an 
intermediate list. */

Review Comment:
   Fair -- fixed.
   
   AI-assisted (Claude Sonnet 5)



-- 
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]

Reply via email to