]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: minor code reorg (cleanup)
authorRobert Griesemer <gri@golang.org>
Wed, 19 Sep 2018 23:19:05 +0000 (16:19 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 20 Sep 2018 00:07:53 +0000 (00:07 +0000)
Found while tracking down #26855.

Change-Id: Ice137fe390820ba351e1c7439b6a9a1b3bdc966b
Reviewed-on: https://go-review.googlesource.com/136396
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/fmt.go

index d3d672ea3292a60769ad4032b693afd419e68970..5d2e36ee51079d91429776b22fd80589f1245d08 100644 (file)
@@ -1304,16 +1304,14 @@ func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) {
                mode.Fprintf(s, "%v { %v }", n.Type, n.Func.Closure.Nbody)
 
        case OCOMPLIT:
-               ptrlit := n.Right != nil && n.Right.Implicit() && n.Right.Type != nil && n.Right.Type.IsPtr()
                if mode == FErr {
                        if n.Right != nil && n.Right.Type != nil && !n.Implicit() {
-                               if ptrlit {
+                               if n.Right.Implicit() && n.Right.Type.IsPtr() {
                                        mode.Fprintf(s, "&%v literal", n.Right.Type.Elem())
                                        return
-                               } else {
-                                       mode.Fprintf(s, "%v literal", n.Right.Type)
-                                       return
                                }
+                               mode.Fprintf(s, "%v literal", n.Right.Type)
+                               return
                        }
 
                        fmt.Fprint(s, "composite literal")