From 5b38923eba10486e98873b657ee2db055780866b Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Fri, 7 Apr 2017 13:48:13 -0700 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Dave Cheney Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/types/type.go | 31 -------------------------- 1 file changed, 31 deletions(-) diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go index 386d2f8d57..196b7b751f 100644 --- a/src/cmd/compile/internal/types/type.go +++ b/src/cmd/compile/internal/types/type.go @@ -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)