mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var ids []driver.TouchID
|
|
||||||
i.ui.m.RLock()
|
i.ui.m.RLock()
|
||||||
defer i.ui.m.RUnlock()
|
defer i.ui.m.RUnlock()
|
||||||
if len(i.touches) == 0 {
|
if len(i.touches) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
ids := make([]driver.TouchID, 0, len(i.touches))
|
||||||
for id := range i.touches {
|
for id := range i.touches {
|
||||||
ids = append(ids, id)
|
ids = append(ids, id)
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ func (i *Input) TouchIDs() []driver.TouchID {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var ids []driver.TouchID
|
ids := make([]driver.TouchID, 0, len(i.touches))
|
||||||
for id := range i.touches {
|
for id := range i.touches {
|
||||||
ids = append(ids, id)
|
ids = append(ids, id)
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ func (i *Input) TouchIDs() []driver.TouchID {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var ids []driver.TouchID
|
ids := make([]driver.TouchID, 0, len(i.touches))
|
||||||
for id := range i.touches {
|
for id := range i.touches {
|
||||||
ids = append(ids, id)
|
ids = append(ids, id)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user