mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +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) {
|
func (i *Image) At(x, y int) (byte, byte, byte, byte) {
|
||||||
backendsM.Lock()
|
backendsM.Lock()
|
||||||
defer backendsM.Unlock()
|
r, g, b, a := i.at(x, y)
|
||||||
return i.at(x, y)
|
backendsM.Unlock()
|
||||||
|
return r, g, b, a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) at(x, y int) (byte, byte, byte, byte) {
|
func (i *Image) at(x, y int) (byte, byte, byte, byte) {
|
||||||
|
Loading…
Reference in New Issue
Block a user