diff options
author | Gusted <williamzijl7@hotmail.com> | 2021-08-04 03:20:42 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-08-04 10:59:46 +0200 |
commit | 5d290410ee22092535533a1ba10ee7ad288342e2 (patch) | |
tree | 34fd8df95e9ce266091e0dc76faea4428b5e651c /plugins/base | |
parent | 477bfd69a6fe378525e486f317322ca4ab4782f2 (diff) | |
download | alps-5d290410ee22092535533a1ba10ee7ad288342e2.tar.gz alps-5d290410ee22092535533a1ba10ee7ad288342e2.zip |
Use shorter if syntax
Diffstat (limited to 'plugins/base')
-rw-r--r-- | plugins/base/routes.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/base/routes.go b/plugins/base/routes.go index 6a733bb..321303d 100644 --- a/plugins/base/routes.go +++ b/plugins/base/routes.go @@ -109,12 +109,11 @@ type CategorizedMailboxes struct { } func (cc *CategorizedMailboxes) Append(mi MailboxInfo, status *MailboxStatus) { - name := mi.Name details := &MailboxDetails{ Info: &mi, Status: status, } - if name == "INBOX" { + if name := mi.Name; name == "INBOX" { cc.Common.Inbox = details } else if name == "Drafts" { cc.Common.Drafts = details @@ -194,8 +193,7 @@ func newIMAPBaseRenderData(ctx *alps.Context, mailboxes[i].Total = int(inbox.Messages) } - status, _ := subscriptions[mailboxes[i].Name] - categorized.Append(mailboxes[i], status) + categorized.Append(mailboxes[i], subscriptions[mailboxes[i].Name]) } return &IMAPBaseRenderData{ |