cckellogg commented on a change in pull request #158: Topic reader 
implementation
URL: https://github.com/apache/pulsar-client-go/pull/158#discussion_r362709923
 
 

 ##########
 File path: pulsar/consumer_partition.go
 ##########
 @@ -247,7 +294,7 @@ func (pc *partitionConsumer) MessageReceived(response 
*pb.CommandMessage, header
        if msgMeta.NumMessagesInBatch != nil {
                numMsgs = int(msgMeta.GetNumMessagesInBatch())
        }
-       messages := make([]*message, numMsgs)
+       messages := make([]*message, 0)
 
 Review comment:
   we can do this `make([]*message, 0, numMsgs)` then append will work and we 
don't ever have to reallocate the slice.

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


With regards,
Apache Git Services

Reply via email to