mirror of
https://github.com/golang/go
synced 2024-11-22 17:44:46 -07:00
cmd/gc: get rid of redundant slice bound check.
For normal slices a[i:j] we're generating 3 bounds checks: j<={len(string),cap(slice)}, j<=j (!), and i<=j. Somehow snuck in as part of the [i:j:k] implementation where the second check does something. Remove the second check when we don't need it. R=rsc, r CC=golang-dev https://golang.org/cl/12311046
This commit is contained in:
parent
49da9a8e44
commit
19e2922688
@ -2623,7 +2623,7 @@ sliceany(Node* n, NodeList **init)
|
|||||||
cb = n->right->right->right;
|
cb = n->right->right->right;
|
||||||
} else {
|
} else {
|
||||||
hb = n->right->right;
|
hb = n->right->right;
|
||||||
cb = hb;
|
cb = N;
|
||||||
}
|
}
|
||||||
|
|
||||||
bounded = n->etype;
|
bounded = n->etype;
|
||||||
|
Loading…
Reference in New Issue
Block a user