ivankelly commented on a change in pull request #2219: Cpp client: add PatternMultiTopicsConsumerImpl
to support regex subscribe
URL: https://github.com/apache/incubator-pulsar/pull/2219#discussion_r205825342
##########
File path: pulsar-client-cpp/lib/ClientConnection.cc
##########
@@ -856,28 +856,35 @@ void ClientConnection::handleIncomingCommand() {
<< " -- req_id: " << error.request_id());
Lock lock(mutex_);
- PendingRequestsMap::iterator it = pendingRequests_.find(error.request_id());
- if (it != pendingRequests_.end()) {
+ if (pendingRequests_.find(error.request_id()) != pendingRequests_.end())
{
Review comment:
You should be able to avoid calling find twice with
```
if ((PendingRequestMap::iterator it = pendingRequests_.find(error.request_id()) != pendingRequests_.end())
{
...
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
|