Skip to content

Commit

Permalink
make map only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rguo-wish authored and zengmin-wish committed Oct 29, 2021
1 parent a4f921d commit 56ec072
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backends/sqs/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,9 @@ func (s *Backend) GetMessages(ctx context.Context, in *rpc.GetMessagesRequest) (
attributes[key] = *valueStruct.StringValue
}

sqsAttributes := make(map[string]string)
var sqsAttributes map[string]string
if in.RequireQueueSystemAttributes {
sqsAttributes = make(map[string]string)
for key, value := range message.Attributes {
sqsAttributes[key] = *value
}
Expand Down

0 comments on commit 56ec072

Please sign in to comment.