mirror of https://github.com/golang/go.git
text/template/parse: preallocate slice in Pipenode.CopyPipe()
This commit is contained in:
parent
60f271358f
commit
a0580df208
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue