From 3c805f2872d500220fcd18e44449f1b365454235 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 28 Jan 2017 23:05:48 -0800 Subject: [PATCH] Remove unnecessary if in parser.Dump Signed-off-by: Anthony Sottile Upstream-commit: 2283cd020373ebd00e5cf37a81df451349c3b506 Component: engine --- components/engine/builder/dockerfile/parser/utils.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/engine/builder/dockerfile/parser/utils.go b/components/engine/builder/dockerfile/parser/utils.go index cd7af75e79..cbb97d4483 100644 --- a/components/engine/builder/dockerfile/parser/utils.go +++ b/components/engine/builder/dockerfile/parser/utils.go @@ -21,13 +21,11 @@ func (node *Node) Dump() string { str += "(" + n.Dump() + ")\n" } - if node.Next != nil { - for n := node.Next; n != nil; n = n.Next { - if len(n.Children) > 0 { - str += " " + n.Dump() - } else { - str += " " + strconv.Quote(n.Value) - } + for n := node.Next; n != nil; n = n.Next { + if len(n.Children) > 0 { + str += " " + n.Dump() + } else { + str += " " + strconv.Quote(n.Value) } }