diff options
author | Ruben Pollan <meskio@sindominio.net> | 2018-01-18 11:55:33 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2018-01-18 11:55:33 +0100 |
commit | 56b9c951111a4627cd5d9f5d8e72623a0c8ecb57 (patch) | |
tree | fe0d015831f923e9d854960e67ba73d2702d839d | |
parent | ad81ddbf91df3d0ece62eab322dfd15e8866193b (diff) |
[style] clean up wait loop
-rw-r--r-- | systray.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 } } } |