Gleiphir2769 commented on code in PR #805:
URL: https://github.com/apache/pulsar-client-go/pull/805#discussion_r1003030610


##########
pulsar/internal/batch_builder.go:
##########
@@ -164,7 +167,11 @@ func (bc *batchContainer) hasSpace(payload []byte) bool {
                return true
        }
        msgSize := uint32(len(payload))
-       return bc.numMessages+1 <= bc.maxMessages && 
bc.buffer.ReadableBytes()+msgSize <= uint32(bc.maxBatchSize)
+       expectedSize := bc.buffer.ReadableBytes() + msgSize

Review Comment:
   > Good catch, but using inline looks like more clear, so like:
   
   I have tried but this line is too long. It can not pass the golangci-lint
   
   > Good catch, but using inline looks like more clear, so like:
   > 
   > ```
   > return bc.numMessages+1 <= bc.maxMessages && expectedSize <= 
uint32(bc.maxBatchSize) && expectedSize <= bc.maxMessageSize
   > ```
   
   Done, thx.



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