graphics: Reduce calling TextureQuad.Len()

This commit is contained in:
Hajime Hoshi 2016-02-17 00:45:19 +09:00
parent 169d57936c
commit d99ddab6f8

View File

@ -48,10 +48,11 @@ func drawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix *[4
shadersInitialized = true
}
if quads.Len() == 0 {
l := quads.Len()
if l == 0 {
return nil
}
if quadsMaxNum < quads.Len() {
if quadsMaxNum < l {
return errors.New(fmt.Sprintf("len(quads) must be equal to or less than %d", quadsMaxNum))
}