From: Kunpei Sakai Date: Mon, 19 Feb 2018 23:42:11 +0000 (+0900) Subject: text/template: avoid assiging unnecessary variable X-Git-Tag: go1.11beta1~1542 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=af7fc752b1c0fe409ad59480aa6f7b290410c92b;p=gostls13.git 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 --- 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