summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-01-18 11:55:33 +0100
committerRuben Pollan <meskio@sindominio.net>2018-01-18 11:55:33 +0100
commit56b9c951111a4627cd5d9f5d8e72623a0c8ecb57 (patch)
treefe0d015831f923e9d854960e67ba73d2702d839d
parentad81ddbf91df3d0ece62eab322dfd15e8866193b (diff)
[style] clean up wait loop
-rw-r--r--systray.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/systray.go b/systray.go
index fa19c0f..0efaa1b 100644
--- a/systray.go
+++ b/systray.go
@@ -141,15 +141,15 @@ func (bt *bmTray) changeStatus(status string) {
}
func (bt *bmTray) waitIcon() {
- i := 0
icons := [][]byte{icon.Wait0, icon.Wait1, icon.Wait2, icon.Wait3}
- for {
+ for i := 0; true; i = (i + 1) % 4 {
systray.SetIcon(icons[i])
+
select {
case <-bt.waitCh:
return
case <-time.After(time.Millisecond * 500):
- i = (i + 1) % 4
+ continue
}
}
}