diff options
author | Robin Jarry <robin@jarry.cc> | 2022-12-21 11:31:04 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-01-04 22:57:31 +0100 |
commit | 5677f93ff8e0f212be112a110fcfe09663c84f98 (patch) | |
tree | 9f47f430b312d1f0dc1acdd3735cfd76ad21e0f0 /widgets/account.go | |
parent | 36fded03e762da97edde61559c8bf60d5749d6a2 (diff) | |
download | aerc-5677f93ff8e0f212be112a110fcfe09663c84f98.tar.gz |
model: change flags array to bitmask
Using a list of integers is not optimal. Use a bit mask instead.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'widgets/account.go')
-rw-r--r-- | widgets/account.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/widgets/account.go b/widgets/account.go index 8b3e6a18..73ee32d0 100644 --- a/widgets/account.go +++ b/widgets/account.go @@ -369,14 +369,9 @@ func (acct *AccountView) updateDirCounts(destination string, uids []uint32) { accurate = false break } - seen := false - for _, flag := range msg.Flags { - if flag == models.SeenFlag { - seen = true - } - if flag == models.RecentFlag { - recent++ - } + seen := msg.Flags.Has(models.SeenFlag) + if msg.Flags.Has(models.RecentFlag) { + recent++ } if !seen { unseen++ |