From 6cf235daef48d99c63b7f6cbfdc578daf6e0059e Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 26 Oct 2024 23:07:03 +0900 Subject: [PATCH] internal/graphicscommand: refactoring --- internal/graphicscommand/command.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index f23fcaa84..f4a34ef56 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -18,6 +18,7 @@ import ( "fmt" "image" "math" + "slices" "strings" "github.com/hajimehoshi/ebiten/v2/internal/graphics" @@ -187,14 +188,9 @@ func (c *drawTrianglesCommand) CanMergeWithDrawTrianglesCommand(dst *Image, srcs if c.shader != shader { return false } - if len(c.uniforms) != len(uniforms) { + if !slices.Equal(c.uniforms, uniforms) { return false } - for i := range c.uniforms { - if c.uniforms[i] != uniforms[i] { - return false - } - } if c.dst != dst { return false }