]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: simplify locking in Named.resolveUnderlying
authorRobert Griesemer <gri@google.com>
Tue, 21 Oct 2025 22:04:46 +0000 (15:04 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 22 Oct 2025 15:23:27 +0000 (08:23 -0700)
commitd09a8c8ef473ba51244d6da9118b956bedb1b20d
treeb98d4589cb2a498938cdfa5c76e42c55928a926b
parent5a42af7f6c9ba057171d8a5af6f4b721b8eff10a
go/types, types2: simplify locking in Named.resolveUnderlying

Avoid calling Named.resolveUnderlying in the first place (there
is only one caller) if Named.underlying exists already.

In Named.resolveUnderlying remove initial atomic check because
of the check in Named.Underlying. Also, remove a 2nd atomic
check after acquiring the lock as it likely won't help much.

Change-Id: Ife87218fa2549d0903a10218f4dd7a70f85d6c7c
Reviewed-on: https://go-review.googlesource.com/c/go/+/713521
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
src/cmd/compile/internal/types2/named.go
src/go/types/named.go