ui: shorten OpReader.Decode for loops

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-12 11:44:50 +02:00
parent 3c2c404fa9
commit 3a6fda129a
4 changed files with 4 additions and 20 deletions
+1 -5
View File
@@ -158,11 +158,7 @@ func (w *Window) Draw(root *ui.Ops) {
func collectRedraws(r *ui.OpsReader) (time.Time, bool) {
var t time.Time
redraw := false
for {
encOp, ok := r.Decode()
if !ok {
break
}
for encOp, ok := r.Decode(); ok; encOp, ok = r.Decode() {
switch ops.OpType(encOp.Data[0]) {
case ops.TypeInvalidate:
var op ui.InvalidateOp