assign to slice rather than append
@@ -363,8 +363,10 @@ func (s *Subscription) RenewLocksBlocking(ctx context.Context, receiver Receiver
// Snapshot the messages to try to renew locks for.
s.mu.RLock()
msgs := make([]*azservicebus.ReceivedMessage, 0, len(s.activeMessages))
+ var i int
for _, m := range s.activeMessages {
- msgs = append(msgs, m)
+ msgs[i] = m
+ i++
}
s.mu.RUnlock()
