mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 23:55:39 +00:00
widget: simplify popping an element from a slice
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user