borisssmidtCET commented on code in PR #14597: URL: https://github.com/apache/kafka/pull/14597#discussion_r1415342634
########## core/src/main/scala/kafka/security/authorizer/AclAuthorizer.scala: ########## @@ -331,12 +330,15 @@ class AclAuthorizer extends Authorizer with Logging { } override def acls(filter: AclBindingFilter): lang.Iterable[AclBinding] = { - val aclBindings = new util.ArrayList[AclBinding]() - aclCache.forKeyValue { case (resource, versionedAcls) => - versionedAcls.acls.foreach { acl => - val binding = new AclBinding(resource, acl.ace) - if (filter.matches(binding)) - aclBindings.add(binding) + val aclBindings = new util.ArrayList[AclBinding](32) Review Comment: the preinitialization of the size is maybe questionalbe. ########## core/src/main/scala/kafka/security/authorizer/AclAuthorizer.scala: ########## @@ -331,12 +330,15 @@ class AclAuthorizer extends Authorizer with Logging { } override def acls(filter: AclBindingFilter): lang.Iterable[AclBinding] = { - val aclBindings = new util.ArrayList[AclBinding]() - aclCache.forKeyValue { case (resource, versionedAcls) => - versionedAcls.acls.foreach { acl => - val binding = new AclBinding(resource, acl.ace) - if (filter.matches(binding)) - aclBindings.add(binding) + val aclBindings = new util.ArrayList[AclBinding](32) Review Comment: the preinitialization of the size is questionable. -- 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