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)
|
||||
q.vertices = append(q.vertices, make([]float32, n)...)
|
||||
}
|
||||
// for-loop might be faster than copy:
|
||||
// On GopherJS, copy might cause subarray calls.
|
||||
for i := range vertices {
|
||||
q.vertices[q.nvertices+i] = vertices[i]
|
||||
}
|
||||
copy(q.vertices[q.nvertices:], vertices)
|
||||
q.nvertices += len(vertices)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user