aerc

Working clone of aerc-mail.org
git clone git://git.danielmoch.com/aerc.git
Log | Files | Refs | README | LICENSE

commit 0b37441f177a46d40aad55f4553fa844bd4dbf6d
parent 8492a21a51c107f743a32231746bf5d38e9b1ccd
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon, 14 Jan 2019 21:11:33 -0500

Make repeated invalidations more efficient

Diffstat:
Mlib/ui/ui.go | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/lib/ui/ui.go b/lib/ui/ui.go @@ -78,6 +78,16 @@ func (state *UI) Tick() bool { } state.Content.Event(event) case <-state.invalidations: + for { + // Flush any other pending invalidations + select { + case <-state.invalidations: + break + default: + goto done + } + } + done: state.Content.Draw(state.ctx) state.screen.Show() default: