]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: use tagged switch
authorIan Alexander <jitsu@google.com>
Mon, 27 Oct 2025 16:34:54 +0000 (12:34 -0400)
committerIan Alexander <jitsu@google.com>
Mon, 27 Oct 2025 20:28:59 +0000 (13:28 -0700)
Minor modernization to use a tagged switch statement in lieu of
if-else chain.

Change-Id: I132d279d421b4a609403f85f9f1ddfc2605a5399
Reviewed-on: https://go-review.googlesource.com/c/go/+/715341
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/stmtlines_test.go

index b55ac2b3f4ecef4b7db425d0c1c36843c4d572e5..2bdd6c80b2d66cf0e10f75eefd6443288e2c45b7 100644 (file)
@@ -138,11 +138,12 @@ func TestStmtLines(t *testing.T) {
        }
 
        var m float64
-       if runtime.GOARCH == "amd64" {
+       switch runtime.GOARCH {
+       case "amd64":
                m = 0.0111 // > 98.89% obtained on amd64, no backsliding
-       } else if runtime.GOARCH == "riscv64" {
+       case "riscv64":
                m = 0.03 // XXX temporary update threshold to 97% for regabi
-       } else {
+       default:
                m = 0.02 // expect 98% elsewhere.
        }