From 873cfe87a165d7105a8d6ea1337b99029290b32d Mon Sep 17 00:00:00 2001 From: neeshy <60193883+neeshy@users.noreply.github.com> Date: Wed, 20 Jan 2021 22:01:49 +0000 Subject: [PATCH] Reduce declaration and assignment (#564) Some code cleanup for #562 --- nav.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/nav.go b/nav.go index b620c5e..9289fd2 100644 --- a/nav.go +++ b/nav.go @@ -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 }