]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: use `else if` for mutually exclusive `if` statements
authorhkhere <33268704+hkhere@users.noreply.github.com>
Wed, 20 Oct 2021 17:26:41 +0000 (17:26 +0000)
committerKeith Randall <khr@golang.org>
Wed, 20 Oct 2021 20:58:15 +0000 (20:58 +0000)
Change-Id: I43e5bb778fbba1398c8006b1644524a9885157db
GitHub-Last-Rev: fa76473ab8b207b8cfc350ca8a26de37dfe57f82
GitHub-Pull-Request: golang/go#47155
Reviewed-on: https://go-review.googlesource.com/c/go/+/334169
Trust: Keith Randall <khr@golang.org>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/typecheck/dcl.go

index 76fc6de6212a39c47a06bade0b600ec7d73b07e8..68ab05a538e8fd52e56686892025dab8e59663e1 100644 (file)
@@ -360,8 +360,7 @@ func funcargs(nt *ir.FuncType) {
                if n.Sym == nil {
                        // Name so that escape analysis can track it. ~r stands for 'result'.
                        n.Sym = LookupNum("~r", i)
-               }
-               if n.Sym.IsBlank() {
+               } else if n.Sym.IsBlank() {
                        // Give it a name so we can assign to it during return. ~b stands for 'blank'.
                        // The name must be different from ~r above because if you have
                        //      func f() (_ int)