diff options
| author | Zeke Lu <lvzecai@gmail.com> | 2022-10-04 07:10:09 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-10-04 23:15:54 +0000 |
| commit | e7d203f494281a229a7d4ef769f14975e9b12e4e (patch) | |
| tree | b89e9726ceb1bbc50ebae8f4832ec2bc1957dacb /src/os/exec | |
| parent | 58158e990f272774e615c9abd8662bf0198c29aa (diff) | |
| download | go-e7d203f494281a229a7d4ef769f14975e9b12e4e.tar.xz | |
reflect: avoid unnecessary copy of funcTypes
Imagine that initFuncTypes is called with n=3, funcTypes will be
[nil, nil, nil, **reflect.rtype] afterward, then it's called with n=2.
The current implementation will copy funcTypes because funcTypes[2] is
nil. This is unnecessary. It should make a new slice and copy funcTypes
into it only when n >= len(funcTypes).
Updates #56011.
Change-Id: Ia093d2f550d6924a4c58bcd21325093e32b40baa
GitHub-Last-Rev: a599eae7c2f6a388dfe1ff39cf61fd645885a64d
GitHub-Pull-Request: golang/go#56024
Reviewed-on: https://go-review.googlesource.com/c/go/+/438395
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/os/exec')
0 files changed, 0 insertions, 0 deletions
