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


##########
pulsar-client-cpp/lib/ConsumerImpl.cc:
##########
@@ -826,6 +826,12 @@ Result ConsumerImpl::receiveHelper(Message& msg, int 
timeout) {
         messageProcessed(msg);
         return ResultOk;
     } else {
+        {
+            Lock lock(mutex_);
+            if (state_ != Ready) {
+                return ResultAlreadyClosed;
+            }
+        }

Review Comment:
   ```suggestion
           Lock lock(mutex_);
           if (state_ != Ready) {
               return ResultAlreadyClosed;
           }
   ```
   
   It is already in the `else {}` block, there is no need to add another nested 
`{}` block.



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

Reply via email to