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) {
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
}