mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-24 18:02:02 +01:00
internal/uidriver/js: Optimization: Reduce the call of js.Value.Get
This commit is contained in:
parent
732b125349
commit
b6cf95f5bb
@ -298,7 +298,8 @@ func (i *Input) updateGamepads() {
|
||||
return
|
||||
}
|
||||
|
||||
if !nav.Get("getGamepads").Truthy() {
|
||||
gamepads := nav.Call("getGamepads")
|
||||
if !gamepads.Truthy() {
|
||||
return
|
||||
}
|
||||
|
||||
@ -306,7 +307,6 @@ func (i *Input) updateGamepads() {
|
||||
delete(i.gamepads, k)
|
||||
}
|
||||
|
||||
gamepads := nav.Call("getGamepads")
|
||||
l := gamepads.Length()
|
||||
for idx := 0; idx < l; idx++ {
|
||||
gp := gamepads.Index(idx)
|
||||
|
Loading…
Reference in New Issue
Block a user