]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/types2: optimize common case in structuralType
authorRobert Griesemer <gri@golang.org>
Sat, 13 Nov 2021 19:02:51 +0000 (11:02 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 15 Nov 2021 21:22:11 +0000 (21:22 +0000)
commit0a39e4a89d26d8375bb5877f736dcc0047894060
treee3c2a53ffb97ee0be03f88593869f905eb5fba8e
parent184ca3cf99864b4112997891b079d106751be25c
cmd/compile/internal/types2: optimize common case in structuralType

Most of the time we don't have a type parameter. Avoid using a
closure in that case.

While at it, rename argument from typ to t (to match style in
that file), and clarify the doc string.

Change-Id: Ie62821073f60f353526263f8b380bad9f72d842e
Reviewed-on: https://go-review.googlesource.com/c/go/+/363668
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/type.go