widgets: remove redundant key check, delete is no-op if key is empty
Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
This commit is contained in:
parent
bdb5e3e658
commit
6338194c4e
1 changed files with 2 additions and 6 deletions
|
@ -105,11 +105,9 @@ func (store *MessageStore) FetchFull(uids []uint32, cb func(io.Reader)) {
|
||||||
switch msg.(type) {
|
switch msg.(type) {
|
||||||
case *types.Error:
|
case *types.Error:
|
||||||
for _, uid := range toFetch {
|
for _, uid := range toFetch {
|
||||||
if _, ok := store.bodyCallbacks[uid]; ok {
|
|
||||||
delete(store.bodyCallbacks, uid)
|
delete(store.bodyCallbacks, uid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,10 +207,8 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
|
||||||
for _, uid := range msg.Uids {
|
for _, uid := range msg.Uids {
|
||||||
toDelete[uid] = nil
|
toDelete[uid] = nil
|
||||||
delete(store.Messages, uid)
|
delete(store.Messages, uid)
|
||||||
if _, ok := store.Deleted[uid]; ok {
|
|
||||||
delete(store.Deleted, uid)
|
delete(store.Deleted, uid)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
uids := make([]uint32, len(store.uids)-len(msg.Uids))
|
uids := make([]uint32, len(store.uids)-len(msg.Uids))
|
||||||
j := 0
|
j := 0
|
||||||
for _, uid := range store.uids {
|
for _, uid := range store.uids {
|
||||||
|
|
Loading…
Reference in a new issue