mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: eliminate NumFields wrapper functions
Change-Id: I3c6035559288cfdc33857216f50241b81932c8a4 Reviewed-on: https://go-review.googlesource.com/20811 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
15ed37d7b7
commit
dbed1c6361
8 changed files with 19 additions and 24 deletions
|
|
@ -592,7 +592,7 @@ func Isinter(t *Type) bool {
|
|||
}
|
||||
|
||||
func isnilinter(t *Type) bool {
|
||||
return Isinter(t) && countfield(t) == 0
|
||||
return Isinter(t) && t.NumFields() == 0
|
||||
}
|
||||
|
||||
func isideal(t *Type) bool {
|
||||
|
|
@ -2388,7 +2388,7 @@ func isdirectiface(t *Type) bool {
|
|||
|
||||
case TSTRUCT:
|
||||
// Struct with 1 field of direct iface type can be direct.
|
||||
return countfield(t) == 1 && isdirectiface(t.Field(0).Type)
|
||||
return t.NumFields() == 1 && isdirectiface(t.Field(0).Type)
|
||||
}
|
||||
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue