mirror of
https://github.com/golang/go.git
synced 2025-05-15 20:34:38 +00:00
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 <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
d4b2168b23
commit
af7fc752b1
@ -125,8 +125,7 @@ func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error
|
|||||||
nt = t.New(name)
|
nt = t.New(name)
|
||||||
}
|
}
|
||||||
// Even if nt == t, we need to install it in the common.tmpl map.
|
// Even if nt == t, we need to install it in the common.tmpl map.
|
||||||
replace := t.associate(nt, tree)
|
if t.associate(nt, tree) || nt.Tree == nil {
|
||||||
if replace || nt.Tree == nil {
|
|
||||||
nt.Tree = tree
|
nt.Tree = tree
|
||||||
}
|
}
|
||||||
return nt, nil
|
return nt, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user