mirror of
https://github.com/golang/go
synced 2024-11-23 01:50:04 -07:00
cmd/gc: eliminate a useless bounds check in inlined append().
R=golang-dev, daniel.morsing, r CC=golang-dev https://golang.org/cl/9358043
This commit is contained in:
parent
6a3859f433
commit
4b0eb19a05
@ -2537,7 +2537,7 @@ append(Node *n, NodeList **init)
|
|||||||
l = list(l, nod(OAS, nn, nod(OLEN, ns, N))); // n = len(s)
|
l = list(l, nod(OAS, nn, nod(OLEN, ns, N))); // n = len(s)
|
||||||
|
|
||||||
nx = nod(OSLICE, ns, nod(OKEY, N, nod(OADD, nn, na))); // ...s[:n+argc]
|
nx = nod(OSLICE, ns, nod(OKEY, N, nod(OADD, nn, na))); // ...s[:n+argc]
|
||||||
nx->bounded = 1;
|
nx->etype = 1;
|
||||||
l = list(l, nod(OAS, ns, nx)); // s = s[:n+argc]
|
l = list(l, nod(OAS, ns, nx)); // s = s[:n+argc]
|
||||||
|
|
||||||
for (a = n->list->next; a != nil; a = a->next) {
|
for (a = n->list->next; a != nil; a = a->next) {
|
||||||
|
Loading…
Reference in New Issue
Block a user