merlimat commented on a change in pull request #1858: Cpp client: add
readCompacted in consumer config
URL: https://github.com/apache/incubator-pulsar/pull/1858#discussion_r191641659
##########
File path: pulsar-client-cpp/lib/ConsumerImpl.cc
##########
@@ -879,4 +883,11 @@ void ConsumerImpl::brokerConsumerStatsListener(Result
res, BrokerConsumerStatsIm
}
}
+bool ConsumerImpl::isReadCompacted() {
+ Lock lock(mutex_);
+ bool ret = readCompacted_;
+ lock.unlock();
+ return ret;
Review comment:
This could be shorthened into:
```cpp
Lock lock(mutex_);
return readCompacted_;
```
Because the lock is automatically released when the destructor runs
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services