Skip to content

Commit

Permalink
Prevent repeated allocation of constant value (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaldivia authored and kannappanr committed Jun 21, 2019
1 parent 916c055 commit f389a72
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions api-notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,14 @@ func (c Client) ListenBucketNotification(bucketName, prefix, suffix string, even
// Indicate to our routine to exit cleanly upon return.
defer close(retryDoneCh)

// Prepare urlValues to pass into the request on every loop
urlValues := make(url.Values)
urlValues.Set("prefix", prefix)
urlValues.Set("suffix", suffix)
urlValues["events"] = events

// Wait on the jitter retry loop.
for range c.newRetryTimerContinous(time.Second, time.Second*30, MaxJitter, retryDoneCh) {
urlValues := make(url.Values)
urlValues.Set("prefix", prefix)
urlValues.Set("suffix", suffix)
urlValues["events"] = events

// Execute GET on bucket to list objects.
resp, err := c.executeMethod(context.Background(), "GET", requestMetadata{
bucketName: bucketName,
Expand Down

0 comments on commit f389a72

Please sign in to comment.