aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/type.go
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2020-10-22 00:25:17 +0700
committerRuss Cox <rsc@golang.org>2020-10-28 17:10:08 +0000
commit642329fdd55aabafc67b3a7c50902e29125621ab (patch)
tree391ec188d728cbc5578b07781d4e155e82f7c34c /src/runtime/type.go
parente3c58bbeb8c76fa3abc0f7153edbab72208c1f88 (diff)
downloadgo-642329fdd55aabafc67b3a7c50902e29125621ab.tar.gz
go-642329fdd55aabafc67b3a7c50902e29125621ab.zip
Revert "cmd/compile: split exported/non-exported methods for interface type"
This reverts commit 8f26b57f9afc238bdecb9b7030bc2f4364093885. Reason for revert: break a bunch of code, include standard library. Fixes #42123 Change-Id: Ife90ecbafd2cb395623d1db555fbfc9c1b0098e0 Reviewed-on: https://go-review.googlesource.com/c/go/+/264026 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/type.go')
-rw-r--r--src/runtime/type.go26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/runtime/type.go b/src/runtime/type.go
index 36492619e1..81455f3532 100644
--- a/src/runtime/type.go
+++ b/src/runtime/type.go
@@ -366,19 +366,7 @@ type imethod struct {
type interfacetype struct {
typ _type
pkgpath name
- // expMethods contains all interface methods.
- //
- // - len(expMethods) returns number of exported methods.
- // - cap(expMethods) returns all interface methods, including both exported/non-exported methods.
- expMethods []imethod
-}
-
-func (it *interfacetype) methods() []imethod {
- return it.expMethods[:cap(it.expMethods)]
-}
-
-func (it *interfacetype) isEmpty() bool {
- return cap(it.expMethods) == 0
+ mhdr []imethod
}
type maptype struct {
@@ -676,15 +664,13 @@ func typesEqual(t, v *_type, seen map[_typePair]struct{}) bool {
if it.pkgpath.name() != iv.pkgpath.name() {
return false
}
- itmethods := it.methods()
- ivmethods := iv.methods()
- if len(itmethods) != len(ivmethods) {
+ if len(it.mhdr) != len(iv.mhdr) {
return false
}
- for i := range itmethods {
- tm := &itmethods[i]
- vm := &ivmethods[i]
- // Note the expMethods array can be relocated from
+ for i := range it.mhdr {
+ tm := &it.mhdr[i]
+ vm := &iv.mhdr[i]
+ // Note the mhdr array can be relocated from
// another module. See #17724.
tname := resolveNameOff(unsafe.Pointer(tm), tm.name)
vname := resolveNameOff(unsafe.Pointer(vm), vm.name)