Commit b65cffdc authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: slightly more idiomatic println code

Updates #21808.

Change-Id: I0314426afcfeed17b1111040110d7f2b0e209526
Reviewed-on: https://go-review.googlesource.com/62430
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 67da5973
...@@ -2071,10 +2071,10 @@ func walkprint(nn *Node, init *Nodes) *Node { ...@@ -2071,10 +2071,10 @@ func walkprint(nn *Node, init *Nodes) *Node {
s := nn.List.Slice() s := nn.List.Slice()
t := make([]*Node, 0, len(s)*2) t := make([]*Node, 0, len(s)*2)
for i, n := range s { for i, n := range s {
t = append(t, n) if i != 0 {
if i != len(s)-1 {
t = append(t, nodstr(" ")) t = append(t, nodstr(" "))
} }
t = append(t, n)
} }
t = append(t, nodstr("\n")) t = append(t, nodstr("\n"))
nn.List.Set(t) nn.List.Set(t)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment