From 49ebf55b1520c6fab0089c4607e43c6d92592517 Mon Sep 17 00:00:00 2001 From: Greg Date: Thu, 10 Oct 2019 11:35:11 -0400 Subject: [PATCH] Fix performance bug in list.Layout(...) --- cmd/passgo-gui/main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/passgo-gui/main.go b/cmd/passgo-gui/main.go index 5715edf..14123b2 100644 --- a/cmd/passgo-gui/main.go +++ b/cmd/passgo-gui/main.go @@ -370,7 +370,7 @@ func eventLoop() { w.Invalidate() page = idPage default: - li := func(i int) { + lst.Layout(gtx, len(passBtns), func(i int) { btn := passBtns[i] btn.Layout(gtx, family) if btn.Clicked() { @@ -401,10 +401,7 @@ func eventLoop() { } }(pathnames[i]) } - } - for i := 0; i < len(passBtns); i++ { - lst.Layout(gtx, len(passBtns), li) - } + }) } mux.Unlock() })