aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/lfstack.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@google.com>2025-10-20 10:25:23 -0700
committerGopher Robot <gobot@golang.org>2025-10-22 08:22:02 -0700
commit5a42af7f6c9ba057171d8a5af6f4b721b8eff10a (patch)
treedacf542d37c1cec833e76f767334da6532c136b4 /src/runtime/lfstack.go
parent4bdb55b5b86fc96addd43a845dabf6b76d100202 (diff)
downloadgo-5a42af7f6c9ba057171d8a5af6f4b721b8eff10a.tar.xz
go/types, types2: in resolveUnderlying, only compute path when needed
When following a RHS chain, the (TypeName) Object path is only needed when there is a cycle (i.e., an error), in which case we can be slow. Rather than always compute the path, only compute it in the error case. In the same vain, allocate the seen map lazily, only when needed. This code could use a test (it doesn't seem to be encountered by our test suite), but I haven't found a case to provoke the error yet. Change-Id: Iff6313394442a251adc56580f746928ec13450fd Reviewed-on: https://go-review.googlesource.com/c/go/+/712321 Auto-Submit: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Mark Freeman <markfreeman@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Diffstat (limited to 'src/runtime/lfstack.go')
0 files changed, 0 insertions, 0 deletions