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


##########
core/src/main/scala/kafka/coordinator/group/GroupMetadata.scala:
##########
@@ -484,10 +484,7 @@ private[group] class GroupMetadata(val groupId: String, 
initialState: GroupState
    * group does not know, because the information is not available yet or 
because the it has
    * failed to parse the Consumer Protocol, it returns true to be safe.
    */
-  def isSubscribedToTopic(topic: String): Boolean = subscribedTopics match {
-    case Some(topics) => topics.contains(topic)
-    case None => true
-  }
+  def isSubscribedToTopic(topic: String): Boolean = 
subscribedTopics.forall(_.contains(topic))

Review Comment:
   FYI reviewers:
   
   This method is only called by `handleOffDeleteRequest` which is not a 
performance sensitive path and hence, unnecessary object allocation in absence 
of `inline-scala` compilation flag should be ok. Opting to favour readibility 
and conciseness of code here.



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