You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2023/01/10 10:40:02 UTC

[GitHub] [kafka] lucasbru commented on a diff in pull request #13096: MINOR: Multiple clean ups associated with scala collection

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


##########
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(topics => topics.contains(topic))

Review Comment:
   or `_.contains(topic)`



-- 
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-unsubscribe@kafka.apache.org

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