chia7712 commented on code in PR #16753:
URL: https://github.com/apache/kafka/pull/16753#discussion_r1702879494
##########
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:
##########
@@ -1196,16 +1196,24 @@ private long maybeDrainPendingCalls(long now) {
long pollTimeout = Long.MAX_VALUE;
log.trace("Trying to choose nodes for {} at {}", pendingCalls,
now);
- Iterator<Call> pendingIter = pendingCalls.iterator();
- while (pendingIter.hasNext()) {
- Call call = pendingIter.next();
+ List<Call> toRemove = new ArrayList<>();
+ int pendingSize = pendingCalls.size();
+ for (int i = 0; i < pendingSize; i++) {
Review Comment:
Please add comments to explain why we use this for-loop style
--
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]