diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-06-21 22:21:40 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-06-21 22:21:40 +0000 |
commit | f4e7200b1df3dde7d2d9cec8861c6567356db40f (patch) | |
tree | 0228f7d9bd47636d53adb5a8e0cc2ec7f110184a /libgo/go/runtime/iface.go | |
parent | 0514cb33749fefd2542e7294a35d0ef0ccae30b3 (diff) | |
download | gcc-f4e7200b1df3dde7d2d9cec8861c6567356db40f.zip gcc-f4e7200b1df3dde7d2d9cec8861c6567356db40f.tar.gz gcc-f4e7200b1df3dde7d2d9cec8861c6567356db40f.tar.bz2 |
runtime: inline and remove eqtype
Now that type equality is just a pointer equality, write it
inlined and remove the eqtype function.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182978
From-SVN: r272578
Diffstat (limited to 'libgo/go/runtime/iface.go')
-rw-r--r-- | libgo/go/runtime/iface.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libgo/go/runtime/iface.go b/libgo/go/runtime/iface.go index 6def738..d434f9e 100644 --- a/libgo/go/runtime/iface.go +++ b/libgo/go/runtime/iface.go @@ -233,7 +233,7 @@ func (m *itab) init() string { ri++ } - if !eqtype(lhsMethod.typ, rhsMethod.mtyp) { + if lhsMethod.typ != rhsMethod.mtyp { m.methods[1] = nil return *lhsMethod.name } @@ -406,7 +406,7 @@ func ifaceI2I2(inter *_type, i iface) (iface, bool) { // Convert an empty interface to a pointer non-interface type. func ifaceE2T2P(t *_type, e eface) (unsafe.Pointer, bool) { - if !eqtype(t, e._type) { + if t != e._type { return nil, false } else { return e.data, true @@ -415,7 +415,7 @@ func ifaceE2T2P(t *_type, e eface) (unsafe.Pointer, bool) { // Convert a non-empty interface to a pointer non-interface type. func ifaceI2T2P(t *_type, i iface) (unsafe.Pointer, bool) { - if i.tab == nil || !eqtype(t, *(**_type)(i.tab)) { + if i.tab == nil || t != *(**_type)(i.tab) { return nil, false } else { return i.data, true @@ -424,7 +424,7 @@ func ifaceI2T2P(t *_type, i iface) (unsafe.Pointer, bool) { // Convert an empty interface to a non-pointer non-interface type. func ifaceE2T2(t *_type, e eface, ret unsafe.Pointer) bool { - if !eqtype(t, e._type) { + if t != e._type { typedmemclr(t, ret) return false } else { @@ -439,7 +439,7 @@ func ifaceE2T2(t *_type, e eface, ret unsafe.Pointer) bool { // Convert a non-empty interface to a non-pointer non-interface type. func ifaceI2T2(t *_type, i iface, ret unsafe.Pointer) bool { - if i.tab == nil || !eqtype(t, *(**_type)(i.tab)) { + if i.tab == nil || t != *(**_type)(i.tab) { typedmemclr(t, ret) return false } else { @@ -485,7 +485,7 @@ func ifaceT2Ip(to, from *_type) bool { ri++ } - if !eqtype(fromMethod.mtyp, toMethod.typ) { + if fromMethod.mtyp != toMethod.typ { return false } |