mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
reflect: sort exported methods first
By moving exported methods to the front of method lists, filtering down to only the exported methods just needs a count of how many exported methods exist, which the compiler can statically provide. This allows getting rid of the exported method cache. For #22075. Change-Id: I8eeb274563a2940e1347c34d673f843ae2569064 Reviewed-on: https://go-review.googlesource.com/100846 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
91bbe5388d
commit
86a338960d
5 changed files with 60 additions and 75 deletions
|
|
@ -329,7 +329,7 @@ type method struct {
|
|||
type uncommontype struct {
|
||||
pkgpath nameOff
|
||||
mcount uint16 // number of methods
|
||||
_ uint16 // unused
|
||||
xcount uint16 // number of exported methods
|
||||
moff uint32 // offset from this uncommontype to [mcount]method
|
||||
_ uint32 // unused
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue