diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2019-02-26 11:56:19 -0800 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2019-02-26 20:11:48 +0000 |
| commit | c63dc6d45956ba471cc88658df4674df3f679a70 (patch) | |
| tree | 14aea70a601c3546b92ed96ba0e01258d3965dd8 /src | |
| parent | d6311ff1e43dd1e7c9cb9edccd10a04b63a7c41f (diff) | |
| download | go-c63dc6d45956ba471cc88658df4674df3f679a70.tar.xz | |
cmd/compile: remove badgerbadgerbadger optimization
As discussed in #29242, this optimization is for a bash-ism.
No one writes Go code like this.
In this repo, it triggers only in test/fixedbugs/bug425.go
and that appears to be accidental.
Fixes #29242
Change-Id: I257e6ecc73f24680f7282c6ab28729de4e8b27af
Reviewed-on: https://go-review.googlesource.com/c/163728
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/gc/walk.go | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index 9bfdaffa62..57bf8a1e0e 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -3342,12 +3342,6 @@ func walkcompareInterface(n *Node, init *Nodes) *Node { } func walkcompareString(n *Node, init *Nodes) *Node { - // s + "badgerbadgerbadger" == "badgerbadgerbadger" - if (n.Op == OEQ || n.Op == ONE) && Isconst(n.Right, CTSTR) && n.Left.Op == OADDSTR && n.Left.List.Len() == 2 && Isconst(n.Left.List.Second(), CTSTR) && strlit(n.Right) == strlit(n.Left.List.Second()) { - r := nod(n.Op, nod(OLEN, n.Left.List.First(), nil), nodintconst(0)) - return finishcompare(n, r, init) - } - // Rewrite comparisons to short constant strings as length+byte-wise comparisons. var cs, ncs *Node // const string, non-const string switch { |
