chia7712 commented on code in PR #19867:
URL: https://github.com/apache/kafka/pull/19867#discussion_r2119352796


##########
core/src/main/scala/kafka/server/ConfigHelper.scala:
##########
@@ -89,15 +89,19 @@ class ConfigHelper(metadataCache: MetadataCache, config: 
KafkaConfig, configRepo
 
       def createResponseConfig(configs: Map[String, Any],
                                createConfigEntry: (String, Any) => 
DescribeConfigsResponseData.DescribeConfigsResourceResult): 
DescribeConfigsResponseData.DescribeConfigsResult = {
-        val filteredConfigPairs = if (resource.configurationKeys == null || 
resource.configurationKeys.isEmpty)
-          configs.toBuffer
-        else
-          configs.filter { case (configName, _) =>
-            resource.configurationKeys.asScala.contains(configName)
-          }.toBuffer
-
-        val configEntries = filteredConfigPairs.map { case (name, value) => 
createConfigEntry(name, value) }
-        new 
DescribeConfigsResponseData.DescribeConfigsResult().setErrorCode(Errors.NONE.code)
+        val configEntries = if (resource.configurationKeys == null || 
resource.configurationKeys.isEmpty) {

Review Comment:
   How about making `configEntries` an `Iterable`? it can be converted to a 
java `List` in `setConfigs`



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