mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
io/router: reuse scratch space in pointerQueue.Frame
This removes the allocation needed to drop all handlers except one. Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
@@ -275,7 +275,7 @@ func (q *pointerQueue) Frame(root *op.Ops, events *handlerEvents) {
|
|||||||
for i, k2 := range p.handlers {
|
for i, k2 := range p.handlers {
|
||||||
if k2 == k {
|
if k2 == k {
|
||||||
// Drop other handlers that lost their grab.
|
// Drop other handlers that lost their grab.
|
||||||
dropped := make([]event.Tag, 0, len(p.handlers)-1)
|
dropped := q.scratch[:0]
|
||||||
dropped = append(dropped, p.handlers[:i]...)
|
dropped = append(dropped, p.handlers[:i]...)
|
||||||
dropped = append(dropped, p.handlers[i+1:]...)
|
dropped = append(dropped, p.handlers[i+1:]...)
|
||||||
for _, tag := range dropped {
|
for _, tag := range dropped {
|
||||||
|
|||||||
Reference in New Issue
Block a user