mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Use copy function in appendVertices
This commit is contained in:
parent
b4ace53596
commit
f6b7a6be73
@ -69,11 +69,7 @@ func (q *commandQueue) appendVertices(vertices []float32) {
|
|||||||
n := q.nvertices + len(vertices) - len(q.vertices)
|
n := q.nvertices + len(vertices) - len(q.vertices)
|
||||||
q.vertices = append(q.vertices, make([]float32, n)...)
|
q.vertices = append(q.vertices, make([]float32, n)...)
|
||||||
}
|
}
|
||||||
// for-loop might be faster than copy:
|
copy(q.vertices[q.nvertices:], vertices)
|
||||||
// On GopherJS, copy might cause subarray calls.
|
|
||||||
for i := range vertices {
|
|
||||||
q.vertices[q.nvertices+i] = vertices[i]
|
|
||||||
}
|
|
||||||
q.nvertices += len(vertices)
|
q.nvertices += len(vertices)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user