assign to slice rather than append
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
This commit is contained in:
parent
c1de465e64
commit
77504a8289
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue