BewareMyPower commented on PR #22283:
URL: https://github.com/apache/pulsar/pull/22283#issuecomment-2008942955

   It seems that `consumerSet` is only used for an efficient implementation of 
`canUnsubscribe`.
   
   ```java
       public synchronized boolean canUnsubscribe(Consumer consumer) {
           return consumerList.size() == 1 && consumerSet.contains(consumer);
       }
   ```
   
   However, I think it's over-designed. When the `consumerList.size()` is 1, 
iterating the `consumerList` should be quick. While I'm going to look deeper to 
see if it's safe to remove the `consumerSet`, so I don't leave a review comment 
that could block this PR.


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