mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
graphics: Refactoring: remove unnecessary empty slices
This commit is contained in:
parent
c19b233ec6
commit
e1b5c992b4
@ -37,10 +37,7 @@ type commandQueue struct {
|
||||
m sync.Mutex
|
||||
}
|
||||
|
||||
var theCommandQueue = &commandQueue{
|
||||
commands: []command{},
|
||||
vertices: []float32{},
|
||||
}
|
||||
var theCommandQueue = &commandQueue{}
|
||||
|
||||
func (q *commandQueue) appendVertices(vertices []float32) {
|
||||
if len(q.vertices) < q.verticesNum+len(vertices) {
|
||||
@ -84,7 +81,7 @@ func (q *commandQueue) Enqueue(command command) {
|
||||
// its limit (maxQuads).
|
||||
func (q *commandQueue) commandGroups() [][]command {
|
||||
cs := q.commands
|
||||
gs := [][]command{}
|
||||
var gs [][]command
|
||||
quads := 0
|
||||
for 0 < len(cs) {
|
||||
if len(gs) == 0 {
|
||||
@ -149,7 +146,7 @@ func (q *commandQueue) Flush(context *opengl.Context) error {
|
||||
}
|
||||
lastN = n
|
||||
}
|
||||
q.commands = []command{}
|
||||
q.commands = nil
|
||||
q.verticesNum = 0
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user