Commit f91c850b authored by Pantelis Sampaziotis's avatar Pantelis Sampaziotis Committed by Andrew Bonventre

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

The required vars slice capacity is known so it can be specified before appending.

Change-Id: Ifa2fe97602e84198c4d01e5a1b0529f3f65f2df1
GitHub-Last-Rev: a0580df208a1d498968138d63508ae4e30df2ec5
GitHub-Pull-Request: golang/go#34613
Reviewed-on: https://go-review.googlesource.com/c/go/+/197997Reviewed-by: default avatarAndrew Bonventre <andybons@golang.org>
parent 8e032b91
......@@ -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))
}
......
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