]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fold IsInBounds with small index
authorAlexandru Moșoi <mosoi@google.com>
Sun, 20 Mar 2016 21:15:27 +0000 (22:15 +0100)
committerAlexandru Moșoi <alexandru@mosoi.ro>
Mon, 21 Mar 2016 23:15:25 +0000 (23:15 +0000)
commit9549c06ce6e379de4554a911ffe8470af8d70daa
treeeb7bb765180da3c3a5dbbd6d432cc9dbafaa0002
parente41f527f4d56a94b33ab73efaae3575760916194
cmd/compile: fold IsInBounds with small index

For the following example, but there are a few more in the stdlib:
func histogram(b []byte, h *[256]int32) {
        for _, t := range b {
                h[t]++
        }
}

Change-Id: I56615f341ae52e02ef34025588dc6d1c52122295
Reviewed-on: https://go-review.googlesource.com/20924
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Alexandru Moșoi <alexandru@mosoi.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/rewritegeneric.go