void-ptr974 commented on code in PR #26019:
URL: https://github.com/apache/pulsar/pull/26019#discussion_r3408871408
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PendingAcksMap.java:
##########
@@ -160,7 +164,7 @@ public boolean addPendingAckIfAllowed(long ledgerId, long
entryId, int remaining
public long size() {
try {
readLock.lock();
- return pendingAcks.values().stream().mapToInt(TreeMap::size).sum();
+ return size;
Review Comment:
Done, thanks for the suggestion. This makes `size()` even cheaper.
--
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]