Commit 19e29226 authored by Keith Randall's avatar Keith Randall

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
parent 49da9a8e
......@@ -2623,7 +2623,7 @@ sliceany(Node* n, NodeList **init)
cb = n->right->right->right;
} else {
hb = n->right->right;
cb = hb;
cb = N;
}
bounded = n->etype;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment