mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
shareable: Avoid defer for performance
This commit is contained in:
parent
fcca95dfa8
commit
382f6365fd
@ -388,8 +388,9 @@ func (i *Image) replacePixels(p []byte) {
|
||||
|
||||
func (i *Image) At(x, y int) (byte, byte, byte, byte) {
|
||||
backendsM.Lock()
|
||||
defer backendsM.Unlock()
|
||||
return i.at(x, y)
|
||||
r, g, b, a := i.at(x, y)
|
||||
backendsM.Unlock()
|
||||
return r, g, b, a
|
||||
}
|
||||
|
||||
func (i *Image) at(x, y int) (byte, byte, byte, byte) {
|
||||
|
Loading…
Reference in New Issue
Block a user