From 6a4ba30c96e7d98a66aa2047e26510aab83d400e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 11 Jul 2019 23:46:11 +0200 Subject: [PATCH] ui/text: shorten event loop in Editor.Layout Signed-off-by: Elias Naur --- ui/text/editor.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ui/text/editor.go b/ui/text/editor.go index 9736672f..cbf2c3fe 100644 --- a/ui/text/editor.go +++ b/ui/text/editor.go @@ -155,10 +155,7 @@ func (e *Editor) Focus() { } func (e *Editor) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimens { - for { - if _, ok := e.Next(); !ok { - break - } + for _, ok := e.Next(); ok; _, ok = e.Next() { } twoDp := e.Config.Px(ui.Dp(2)) e.padLeft, e.padRight = twoDp, twoDp