From: Josh Bleecher Snyder Date: Tue, 7 Jan 2020 22:30:17 +0000 (-0800) Subject: cmd/compile: normalize whitespace around square brackets X-Git-Tag: go1.15beta1~1175 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4084c125cce2b5a6009fe767cc39a1ec28914786;p=gostls13.git cmd/compile: normalize whitespace around square brackets I noticed some instances of "[ " and " ]" in the rewrite rules. Normalizing them helps catch possible future duplicate rules. Change-Id: I892fd7e9b4019ed304f0a61fa2bb7f7e47ef8f38 Reviewed-on: https://go-review.googlesource.com/c/go/+/213682 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/compile/internal/ssa/gen/rulegen.go b/src/cmd/compile/internal/ssa/gen/rulegen.go index 77927cfbd3..7c6e1b29dd 100644 --- a/src/cmd/compile/internal/ssa/gen/rulegen.go +++ b/src/cmd/compile/internal/ssa/gen/rulegen.go @@ -1442,6 +1442,8 @@ func normalizeWhitespace(x string) string { x = strings.Join(strings.Fields(x), " ") x = strings.Replace(x, "( ", "(", -1) x = strings.Replace(x, " )", ")", -1) + x = strings.Replace(x, "[ ", "[", -1) + x = strings.Replace(x, " ]", "]", -1) x = strings.Replace(x, ")->", ") ->", -1) return x }