pkumar-singh commented on a change in pull request #8283:
URL: https://github.com/apache/pulsar/pull/8283#discussion_r506750842
##########
File path: pulsar-client-cpp/lib/Commands.cc
##########
@@ -675,7 +675,7 @@ uint64_t
Commands::serializeSingleMessageInBatchWithPayload(const Message& msg,
<< batchPayLoad.writableBytes() << "] can't accomodate new
payload [" << requiredSpace
<< "] - expanding the batchPayload buffer");
SharedBuffer buffer =
SharedBuffer::allocate(batchPayLoad.readableBytes() +
- std::max(requiredSpace,
maxMessageSizeInBytes));
+ std::min(requiredSpace,
maxMessageSizeInBytes));
Review comment:
Why even do minimum then. Internally it's any way a vector so it will
reallocate.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]