From 7b4617fa6e62d7e1c7303ec51305668dae18c495 Mon Sep 17 00:00:00 2001 From: Kevin Atkinson Date: Sat, 1 Sep 2018 00:09:38 -0400 Subject: [PATCH] Eliminate unnecessary copy of Cid now that its an immutable string. --- set.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/set.go b/set.go index 4591007..eb3b3f0 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 } - -- GitLab