Prevent unnecessary (superfluous) initialization of return variable (#4490)

master
Frank Wessels 8 years ago committed by Dee Koder
parent 999ae1cb96
commit 7dcc1e92b4
  1. 7
      cmd/bucket-notification-utils.go

@ -259,15 +259,14 @@ func validateNotificationConfig(nConfig notificationConfig) APIErrorCode {
// - kafka // - kafka
// - webhook // - webhook
func unmarshalSqsARN(queueARN string) (mSqs arnSQS) { func unmarshalSqsARN(queueARN string) (mSqs arnSQS) {
mSqs = arnSQS{}
strs := strings.SplitN(queueARN, ":", -1) strs := strings.SplitN(queueARN, ":", -1)
if len(strs) != 6 { if len(strs) != 6 {
return mSqs return
} }
if serverConfig.GetRegion() != "" { if serverConfig.GetRegion() != "" {
region := strs[3] region := strs[3]
if region != serverConfig.GetRegion() { if region != serverConfig.GetRegion() {
return mSqs return
} }
} }
sqsType := strs[5] sqsType := strs[5]
@ -294,5 +293,5 @@ func unmarshalSqsARN(queueARN string) (mSqs arnSQS) {
mSqs.AccountID = strs[4] mSqs.AccountID = strs[4]
return mSqs return
} }

Loading…
Cancel
Save