Commit 7b4617fa authored by Kevin Atkinson's avatar Kevin Atkinson

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

parent 440a1c1a
...@@ -55,8 +55,7 @@ func (s *Set) Visit(c Cid) bool { ...@@ -55,8 +55,7 @@ func (s *Set) Visit(c Cid) bool {
// ForEach allows to run a custom function on each // ForEach allows to run a custom function on each
// Cid in the set. // Cid in the set.
func (s *Set) ForEach(f func(c Cid) error) error { func (s *Set) ForEach(f func(c Cid) error) error {
for cs := range s.set { for c := range s.set {
c, _ := Cast(cs.Bytes())
err := f(c) err := f(c)
if err != nil { if err != nil {
return err return err
...@@ -64,4 +63,3 @@ func (s *Set) ForEach(f func(c Cid) error) error { ...@@ -64,4 +63,3 @@ func (s *Set) ForEach(f func(c Cid) error) error {
} }
return nil return nil
} }
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