]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: get rid of redundant slice bound check.
authorKeith Randall <khr@golang.org>
Mon, 5 Aug 2013 20:24:33 +0000 (13:24 -0700)
committerKeith Randall <khr@golang.org>
Mon, 5 Aug 2013 20:24:33 +0000 (13:24 -0700)
commit19e292268896c245c781e711ae3fff5ff5e127e5
tree39acdab0d72549f1d313514e6badf828112f1d4f
parent49da9a8e44fecbf9b3287472b6554419840b03b5
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
src/cmd/gc/walk.c