mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
internal/uidriver: Optimization
This commit is contained in:
parent
b8694aa66a
commit
2dadfdb88e
@ -164,12 +164,12 @@ func (i *Input) TouchIDs() []driver.TouchID {
|
||||
return nil
|
||||
}
|
||||
|
||||
var ids []driver.TouchID
|
||||
i.ui.m.RLock()
|
||||
defer i.ui.m.RUnlock()
|
||||
if len(i.touches) == 0 {
|
||||
return nil
|
||||
}
|
||||
ids := make([]driver.TouchID, 0, len(i.touches))
|
||||
for id := range i.touches {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ func (i *Input) TouchIDs() []driver.TouchID {
|
||||
return nil
|
||||
}
|
||||
|
||||
var ids []driver.TouchID
|
||||
ids := make([]driver.TouchID, 0, len(i.touches))
|
||||
for id := range i.touches {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ func (i *Input) TouchIDs() []driver.TouchID {
|
||||
return nil
|
||||
}
|
||||
|
||||
var ids []driver.TouchID
|
||||
ids := make([]driver.TouchID, 0, len(i.touches))
|
||||
for id := range i.touches {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user