chia7712 commented on code in PR #20410:
URL: https://github.com/apache/kafka/pull/20410#discussion_r2300546215
##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -788,7 +788,9 @@ class ReplicaManager(val config: KafkaConfig,
hasCustomErrorMessage = customException.isDefined
)
}
- val entriesWithoutErrorsPerPartition = entriesPerPartition.filter { case
(key, _) => !errorResults.contains(key) }
+ val entriesWithoutErrorsPerPartition =
+ if (errorResults.nonEmpty) entriesPerPartition.filter { case (key, _)
=> !errorResults.contains(key) }
+ else entriesPerPartition
Review Comment:
Could you please add comments explaining the minor optimization?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]