internal/graphicscommand: reduce boundary checks

This can be confirmed by this command:

```
go build -gcflags="-d=ssa/check_bce" ./internal/graphicscommand/
```

Updates #2601
This commit is contained in:
Hajime Hoshi 2023-08-21 03:15:31 +09:00
parent bcc2ead670
commit 2de64088dc

View File

@ -100,8 +100,8 @@ func switchCommandQueue() {
func (q *commandQueue) appendIndices(indices []uint16, offset uint16) {
n := len(q.indices)
q.indices = append(q.indices, indices...)
for i := range indices {
q.indices[n+i] += offset
for i := n; i < len(q.indices); i++ {
q.indices[i] += offset
}
}