widget: simplify popping an element from a slice

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-05-11 12:47:27 +02:00
parent fd2cb4a7a1
commit 43c2b90716
+2 -2
View File
@@ -56,8 +56,8 @@ func (b *Button) Layout(gtx *layout.Context) {
if gtx.Now().Sub(c.Time) < 1*time.Second {
break
}
copy(b.history, b.history[1:])
b.history = b.history[:len(b.history)-1]
n := copy(b.history, b.history[1:])
b.history = b.history[:n]
}
}