Commit af7fc752 authored by Kunpei Sakai's avatar Kunpei Sakai Committed by Ian Lance Taylor

text/template: avoid assiging unnecessary variable

This follows up CL95235

Change-Id: I62652654e5bb46d2f8f37af468e1fbcc1835bb8a
Reviewed-on: https://go-review.googlesource.com/95295Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent d4b2168b
......@@ -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
......
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