BewareMyPower commented on code in PR #21343:
URL: https://github.com/apache/pulsar/pull/21343#discussion_r1365450685


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:
##########
@@ -686,16 +688,22 @@ private boolean 
checkCanRemovePendingAcksAndHandle(PositionImpl position, Messag
         return false;
     }
 
+    private boolean 
checkCanRemovePendingAcksAndHandleWithOwnedConsumer(PositionImpl position,

Review Comment:
   ```suggestion
       private boolean 
canRemovePendingAcksAndHandleWithOwnedConsumer(PositionImpl position,
   ```
   
   I don't know who named `checkCan`, but it seems `canXxx` is more direct than 
`checkCan`.



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java:
##########
@@ -686,16 +688,22 @@ private boolean 
checkCanRemovePendingAcksAndHandle(PositionImpl position, Messag
         return false;
     }
 
+    private boolean 
checkCanRemovePendingAcksAndHandleWithOwnedConsumer(PositionImpl position,
+                                                                   
MessageIdData msgId,
+                                                                   Consumer 
ackOwnerConsumer) {
+        if (Subscription.isIndividualAckMode(subType) && 
msgId.getAckSetsCount() == 0) {
+            return removePendingAckWithOwnedConsumer(position, 
ackOwnerConsumer);
+        }
+        return false;

Review Comment:
   We can merge it with three expressions operated by AND.
   
   ```java
   return Subscription.isIndividualAckMode(subType)
     && msgId.getAckSetsCount() == 0
     && removePendingAckWithOwnedConsumer(position, ackOwnerConsumer);
   ``` 



-- 
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: commits-unsubscr...@pulsar.apache.org

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

Reply via email to