Eliminate unnecessary copy of Cid now that its an immutable string.

This commit is contained in:
Kevin Atkinson
2018-09-01 00:09:38 -04:00
parent 440a1c1a5a
commit 7b4617fa6e

4
set.go
View File

@@ -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
}