]> Cypherpunks repositories - gostls13.git/commit
text/template: further simplify building the vars list
authorRob Pike <r@golang.org>
Mon, 30 Sep 2019 23:54:30 +0000 (09:54 +1000)
committerRob Pike <r@golang.org>
Tue, 1 Oct 2019 00:00:02 +0000 (00:00 +0000)
commit27cf81e1b48efe6a6387f34c7114766c7b0d4d73
tree40401f4f0c1341c168022ad5808dd5f8a4f1754e
parente76b9e8908bdcdb4363d6bd23aa7ff3120237426
text/template: further simplify building the vars list

Followup to https://golang.org/cl/197997

If you know the number of elements, you don't need append at all.
Either use append to grow, or allocate and index. Here we choose
number 2.

Change-Id: Ic58637231789640ff7b293ece04a95a8de7ccf8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/198097
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/text/template/parse/node.go