]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: remove n.SetLikely(false) usage
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 13 Sep 2019 02:58:35 +0000 (09:58 +0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 25 Sep 2019 18:10:51 +0000 (18:10 +0000)
commite0dde990de11c73ae11b2f1a42de37143c6bfb7c
treee45b0913bcd5109e6cd3773ae18a4ba59a25eb3d
parent21bf37b5a2052e5aaedbd17abeca7eb263cba706
cmd/compile: remove n.SetLikely(false) usage

n.SetLikely(false) is probably mean to indicate that the branch is
"unlikely", but it has the real effect of not marking branch as likely.

So invert the test condition, we can use more meaningful n.SetLikely(true).

Before:

if l2 < 0 {
panicmakeslicelen()
}

After:

if l2 >= 0 {
} else {
panicmakeslicelen
}

Fixes #32486

Change-Id: I156fdba1f9a5d554a178c8903f1a391ed304199d
Reviewed-on: https://go-review.googlesource.com/c/go/+/195197
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/walk.go