Reduce declaration and assignment (#564)

Some code cleanup for #562
This commit is contained in:
neeshy 2021-01-20 22:01:49 +00:00 committed by GitHub
parent 3f66f08b84
commit 873cfe87a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

9
nav.go
View File

@ -462,17 +462,12 @@ func (nav *nav) position() {
func (nav *nav) previewLoop(ui *ui) { func (nav *nav) previewLoop(ui *ui) {
var prev string var prev string
for path := range nav.previewChan { for path := range nav.previewChan {
var clear bool clear := len(path) == 0
if len(path) == 0 {
clear = true
}
loop: loop:
for { for {
select { select {
case path = <-nav.previewChan: case path = <-nav.previewChan:
if len(path) == 0 { clear = clear || len(path) == 0
clear = true
}
default: default:
break loop break loop
} }