internal/uidriver/mobile: Reduce calling make

This commit is contained in:
Hajime Hoshi 2021-10-16 20:09:36 +09:00
parent efdb31a524
commit c3b4b92fa2

View File

@ -205,14 +205,14 @@ func (i *Input) update(keys map[driver.Key]struct{}, runes []rune, touches []Tou
i.keys[k] = struct{}{} i.keys[k] = struct{}{}
} }
i.runes = make([]rune, len(runes)) i.runes = i.runes[:0]
copy(i.runes, runes) i.runes = append(i.runes, runes...)
i.touches = make([]Touch, len(touches)) i.touches = i.touches[:0]
copy(i.touches, touches) i.touches = append(i.touches, touches...)
i.gamepads = make([]Gamepad, len(gamepads)) i.gamepads = i.gamepads[:0]
copy(i.gamepads, gamepads) i.gamepads = append(i.gamepads, gamepads...)
} }
func (i *Input) resetForFrame() { func (i *Input) resetForFrame() {