From af7fc752b1c0fe409ad59480aa6f7b290410c92b Mon Sep 17 00:00:00 2001 From: Kunpei Sakai Date: Tue, 20 Feb 2018 08:42:11 +0900 Subject: [PATCH] text/template: avoid assiging unnecessary variable This follows up CL95235 Change-Id: I62652654e5bb46d2f8f37af468e1fbcc1835bb8a Reviewed-on: https://go-review.googlesource.com/95295 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/text/template/template.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/text/template/template.go b/src/text/template/template.go index 9ca0705ecc..41cdd5682c 100644 --- a/src/text/template/template.go +++ b/src/text/template/template.go @@ -125,8 +125,7 @@ func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error nt = t.New(name) } // Even if nt == t, we need to install it in the common.tmpl map. - replace := t.associate(nt, tree) - if replace || nt.Tree == nil { + if t.associate(nt, tree) || nt.Tree == nil { nt.Tree = tree } return nt, nil -- 2.48.1