aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/msgstore.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index 8e0785a6..7cdc5810 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -298,13 +298,12 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
delete(store.Messages, uid)
delete(store.Deleted, uid)
}
- uids := make([]uint32, len(store.uids)-len(msg.Uids))
- j := 0
+ uids := make([]uint32, 0, len(store.uids)-len(msg.Uids))
for _, uid := range store.uids {
- if _, deleted := toDelete[uid]; !deleted && j < len(uids) {
- uids[j] = uid
- j += 1
+ if _, deleted := toDelete[uid]; deleted {
+ continue
}
+ uids = append(uids, uid)
}
store.uids = uids
if len(uids) == 0 {