From 77a8ece691c3184e91723911425f03876bd72e6d Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 16 Nov 2019 01:38:32 +0900 Subject: [PATCH] graphics: Remove unnecessary copying pixels Updates #983 --- image.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/image.go b/image.go index 2a44381eb..42a2f9558 100644 --- a/image.go +++ b/image.go @@ -454,9 +454,7 @@ func (i *Image) ReplacePixels(p []byte) error { panic(fmt.Sprintf("ebiten: len(p) was %d but must be %d", len(p), l)) } - px := make([]byte, len(p)) - copy(px, p) - i.mipmap.replacePixels(px) + i.mipmap.replacePixels(p) return nil }