mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +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 {
|
if gtx.Now().Sub(c.Time) < 1*time.Second {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
copy(b.history, b.history[1:])
|
n := copy(b.history, b.history[1:])
|
||||||
b.history = b.history[:len(b.history)-1]
|
b.history = b.history[:n]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user