Simplify code by removing else block

This commit is contained in:
Christian Muehlhaeuser 2021-03-12 13:30:30 +01:00
parent 2d8f8c2d64
commit e5ec06b3b9
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E

View file

@ -1236,14 +1236,13 @@ func (m stashModel) headerView() string {
if m.filterState == filtering { if m.filterState == filtering {
if localCount+stashedCount+newsCount == 0 { if localCount+stashedCount+newsCount == 0 {
return grayFg("Nothing found.") return grayFg("Nothing found.")
} else { }
if localCount > 0 { if localCount > 0 {
sections = append(sections, fmt.Sprintf("%d local", localCount)) sections = append(sections, fmt.Sprintf("%d local", localCount))
} }
if stashedCount > 0 { if stashedCount > 0 {
sections = append(sections, fmt.Sprintf("%d stashed", stashedCount)) sections = append(sections, fmt.Sprintf("%d stashed", stashedCount))
} }
}
for i := range sections { for i := range sections {
sections[i] = grayFg(sections[i]) sections[i] = grayFg(sections[i])