rite2nikhil commented on a change in pull request #9626:
URL: https://github.com/apache/kafka/pull/9626#discussion_r539900024



##########
File path: 
clients/src/main/java/org/apache/kafka/common/requests/LeaderAndIsrResponse.java
##########
@@ -58,8 +68,17 @@ public Errors error() {
         Errors error = error();
         if (error != Errors.NONE)
             // Minor optimization since the top-level error applies to all 
partitions
-            return Collections.singletonMap(error, 
data.partitionErrors().size());
-        return errorCounts(data.partitionErrors().stream().map(l -> 
Errors.forCode(l.errorCode())));
+            if (data.topics().isEmpty()) {
+                return Collections.singletonMap(error, 
data.partitionErrors().size());
+            } else {

Review comment:
       nit: is the else statement needed all it has is return?




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

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


Reply via email to