Skip to content

Commit

Permalink
Reduce declaration and assignment (#564)
Browse files Browse the repository at this point in the history
Some code cleanup for #562
  • Loading branch information
neeshy authored Jan 20, 2021
1 parent 3f66f08 commit 873cfe8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions nav.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,17 +462,12 @@ func (nav *nav) position() {
func (nav *nav) previewLoop(ui *ui) {
var prev string
for path := range nav.previewChan {
var clear bool
if len(path) == 0 {
clear = true
}
clear := len(path) == 0
loop:
for {
select {
case path = <-nav.previewChan:
if len(path) == 0 {
clear = true
}
clear = clear || len(path) == 0
default:
break loop
}
Expand Down

0 comments on commit 873cfe8

Please sign in to comment.