hachikuji commented on code in PR #12929:
URL: https://github.com/apache/kafka/pull/12929#discussion_r1036561426


##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -2749,13 +2749,12 @@ class KafkaApis(val requestChannel: RequestChannel,
       )
     }
 
-    val partitionsOpt = listPartitionReassignmentsRequest.data.topics match {
-      case topics: Any =>
-        Some(topics.iterator().asScala.flatMap { topic =>
-          topic.partitionIndexes.iterator().asScala
-            .map { tp => new TopicPartition(topic.name(), tp) }
-        }.toSet)
-      case _ => None
+    val partitionsOpt = 
Option(listPartitionReassignmentsRequest.data.topics).map { topics =>
+      topics.iterator().asScala.flatMap { topic =>
+        topic.partitionIndexes.iterator().asScala.map { tp =>

Review Comment:
   nit: usually `tp` is reserved for `TopicPartition` instances, which makes 
this code look a bit funny. Perhaps we could rename the variable to 
`partitionIndex`?



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