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


##########
core/src/main/scala/kafka/controller/ControllerContext.scala:
##########
@@ -487,7 +487,7 @@ class ControllerContext extends ControllerChannelContext {
     partitionLeadershipInfo.filter { case (topicPartition, 
leaderIsrAndControllerEpoch) =>
       !isTopicQueuedUpForDeletion(topicPartition.topic) &&
         leaderIsrAndControllerEpoch.leaderAndIsr.leader == brokerId &&
-        partitionReplicaAssignment(topicPartition).size > 1
+        partitionReplicaAssignment(topicPartition).lengthCompare(1) > 0

Review Comment:
   The `lengthCompare` code is quite a bit less readable. Does it actually 
matter for the various code like this one? For example, if the Seq 
implementation is not `scala.List`, it won't make any difference aside from 
making the code less readable.



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