forked from joejulian/gio
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 {
|
||||
if k2 == k {
|
||||
// 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+1:]...)
|
||||
for _, tag := range dropped {
|
||||
|
||||
Reference in New Issue
Block a user