diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-04 19:18:44 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-04 19:18:44 +0100 |
commit | ceccd394200b9152f4df57e5bbe7d7e9002b8704 (patch) | |
tree | 877ac749a2bdde2d1455630a211134bbc31edb1b /timer.go | |
parent | 283e7117cfd4be3c524701de20307faef7ebcf86 (diff) |
Work on logging format
Diffstat (limited to 'timer.go')
-rw-r--r-- | timer.go | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -12,8 +12,7 @@ type Timer struct { /* Starts the timer if not already pending */ func (t *Timer) Start(dur time.Duration) bool { - set := t.pending.Swap(true) - if !set { + if !t.pending.Swap(true) { t.timer.Reset(dur) return true } @@ -23,8 +22,7 @@ func (t *Timer) Start(dur time.Duration) bool { /* Stops the timer */ func (t *Timer) Stop() { - set := t.pending.Swap(true) - if set { + if t.pending.Swap(true) { t.timer.Stop() select { case <-t.timer.C: |