Commit 5b38923e authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile/internal/types: remove IterFields

No longer needed after previous CLs.

Change-Id: I9dd1040f3f28363c44434a810cbd7061cf6a028f
Reviewed-on: https://go-review.googlesource.com/39857
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarDave Cheney <dave@cheney.net>
Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent 31585837
......@@ -671,37 +671,6 @@ func (f *Field) Copy() *Field {
return &nf
}
// Iter provides an abstraction for iterating across struct fields and
// interface methods.
type Iter struct {
s []*Field
}
// IterFields returns the first field or method in struct or interface type t
// and an Iter value to continue iterating across the rest.
func IterFields(t *Type) (*Field, Iter) {
return t.Fields().Iter()
}
// Iter returns the first field in fs and an Iter value to continue iterating
// across its successor fields.
// Deprecated: New code should use Slice instead.
func (fs *Fields) Iter() (*Field, Iter) {
i := Iter{s: fs.Slice()}
f := i.Next()
return f, i
}
// Next returns the next field or method, if any.
func (i *Iter) Next() *Field {
if len(i.s) == 0 {
return nil
}
f := i.s[0]
i.s = i.s[1:]
return f
}
func (t *Type) wantEtype(et EType) {
if t.Etype != et {
Fatalf("want %v, but have %v", et, t)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment