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>
diff --git a/src/cmd/compile/internal/gc/bexport.go b/src/cmd/compile/internal/gc/bexport.go
index d6f3a51..7e5dbb0 100644
--- a/src/cmd/compile/internal/gc/bexport.go
+++ b/src/cmd/compile/internal/gc/bexport.go
@@ -559,12 +559,12 @@
}
func (p *exporter) fieldList(t *Type) {
- if p.trace && countfield(t) > 0 {
+ if p.trace && t.NumFields() > 0 {
p.tracef("fields {>")
defer p.tracef("<\n} ")
}
- p.int(countfield(t))
+ p.int(t.NumFields())
for _, f := range t.Fields().Slice() {
if p.trace {
p.tracef("\n")
@@ -588,12 +588,12 @@
}
func (p *exporter) methodList(t *Type) {
- if p.trace && countfield(t) > 0 {
+ if p.trace && t.NumFields() > 0 {
p.tracef("methods {>")
defer p.tracef("<\n} ")
}
- p.int(countfield(t))
+ p.int(t.NumFields())
for _, m := range t.Fields().Slice() {
if p.trace {
p.tracef("\n")
@@ -650,7 +650,7 @@
// use negative length to indicate unnamed parameters
// (look at the first parameter only since either all
// names are present or all are absent)
- n := countfield(params)
+ n := params.NumFields()
if n > 0 && parName(params.Field(0), numbered) == "" {
n = -n
}