all: fix minor issues found by staticcheck
Signed-off-by: Moritz Poldrack <git@moritz.sh>
This commit is contained in:
parent
65ae87a524
commit
4bc43d2741
11 changed files with 17 additions and 27 deletions
commands/msg
|
@ -88,15 +88,14 @@ func findNextNonDeleted(deleted []uint32, store *lib.MessageStore) *models.Messa
|
|||
if !contains(deleted, selected.Uid) {
|
||||
return selected
|
||||
}
|
||||
for {
|
||||
store.Next()
|
||||
next := store.Selected()
|
||||
if next == selected || next == nil {
|
||||
// the last message is in the deleted state or doesn't exist
|
||||
return nil
|
||||
}
|
||||
return next
|
||||
|
||||
store.Next()
|
||||
next := store.Selected()
|
||||
if next == selected || next == nil {
|
||||
// the last message is in the deleted state or doesn't exist
|
||||
return nil
|
||||
}
|
||||
return next
|
||||
}
|
||||
|
||||
func contains(uids []uint32, uid uint32) bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue