diff --git a/set.go b/set.go index 4591007836f2fd96f62506077bc0948b5fb6fd45..eb3b3f0dc15bd40037e98937a0522bdb350ace8a 100644 --- a/set.go +++ b/set.go @@ -55,8 +55,7 @@ func (s *Set) Visit(c Cid) bool { // ForEach allows to run a custom function on each // Cid in the set. func (s *Set) ForEach(f func(c Cid) error) error { - for cs := range s.set { - c, _ := Cast(cs.Bytes()) + for c := range s.set { err := f(c) if err != nil { return err @@ -64,4 +63,3 @@ func (s *Set) ForEach(f func(c Cid) error) error { } return nil } -