mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: use NumElem instead of Type.Bound
This eliminates all direct reads of Type.Bound outside type.go. Change-Id: I0a9a72539f8f4c0de7f5e05e1821936bf7db5eb7 Reviewed-on: https://go-review.googlesource.com/21421 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
077902d1a6
commit
3a0783c504
14 changed files with 48 additions and 44 deletions
|
|
@ -739,7 +739,7 @@ func eqtype1(t1, t2 *Type, assumedEqual map[typePair]struct{}) bool {
|
|||
return true
|
||||
|
||||
case TARRAY:
|
||||
if t1.Bound != t2.Bound {
|
||||
if t1.NumElem() != t2.NumElem() {
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
@ -2255,7 +2255,7 @@ func isdirectiface(t *Type) bool {
|
|||
|
||||
case TARRAY:
|
||||
// Array of 1 direct iface type can be direct.
|
||||
return t.Bound == 1 && isdirectiface(t.Elem())
|
||||
return t.NumElem() == 1 && isdirectiface(t.Elem())
|
||||
|
||||
case TSTRUCT:
|
||||
// Struct with 1 field of direct iface type can be direct.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue