mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
graphics: Replace copy with for-loop
This commit is contained in:
parent
3b25289a18
commit
e53262bfac
@ -44,7 +44,11 @@ func (q *commandQueue) appendVertices(vertices []float32) {
|
|||||||
n := q.verticesNum + len(vertices) - len(q.vertices)
|
n := q.verticesNum + len(vertices) - len(q.vertices)
|
||||||
q.vertices = append(q.vertices, make([]float32, n)...)
|
q.vertices = append(q.vertices, make([]float32, n)...)
|
||||||
}
|
}
|
||||||
copy(q.vertices[q.verticesNum:q.verticesNum+len(vertices)], vertices)
|
// for-loop might be faster than copy:
|
||||||
|
// On GopherJS, copy might cause subarray calls.
|
||||||
|
for i := 0; i < len(vertices); i++ {
|
||||||
|
q.vertices[q.verticesNum+i] = vertices[i]
|
||||||
|
}
|
||||||
q.verticesNum += len(vertices)
|
q.verticesNum += len(vertices)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user