divijvaidya commented on code in PR #13096:
URL: https://github.com/apache/kafka/pull/13096#discussion_r1067053138


##########
core/src/main/scala/kafka/controller/KafkaController.scala:
##########
@@ -1420,7 +1420,7 @@ class KafkaController(val config: KafkaConfig,
     val replicasInError = partitionsInError.map(PartitionAndReplica(_, 
replicaId))
     // move all the failed replicas to ReplicaDeletionIneligible
     topicDeletionManager.failReplicaDeletion(replicasInError)
-    if (replicasInError.size != partitionErrors.size) {
+    if (replicasInError.sizeCompare(partitionErrors) != 0) {

Review Comment:
   FYI reviewers - 
   Comparison of two iterables. Reduces comparison time complexity from 
`O(this.size + that.size)` to `O(this.size min that.size)`



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to