text/template/parse: preallocate slice in Pipenode.CopyPipe()

This commit is contained in:
Pantelis Sampaziotis 2019-09-30 18:41:13 +03:00
parent 60f271358f
commit a0580df208
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ func (p *PipeNode) CopyPipe() *PipeNode {
if p == nil {
return p
}
var vars []*VariableNode
vars := make([]*VariableNode, 0, len(p.Decl))
for _, d := range p.Decl {
vars = append(vars, d.Copy().(*VariableNode))
}