first visit the cid, then short-circuit non dagcbor objects

This commit is contained in:
vyzo 2021-03-24 18:23:47 +02:00
parent bdb97d6186
commit d33a44e67f

View File

@ -891,14 +891,14 @@ func (s *SplitStore) walkLinks(c cid.Cid, walked *cid.Set, f func(cid.Cid) error
return nil return nil
} }
if c.Prefix().Codec != cid.DagCBOR {
return nil
}
if err := f(c); err != nil { if err := f(c); err != nil {
return err return err
} }
if c.Prefix().Codec != cid.DagCBOR {
return nil
}
blk, err := s.Get(c) blk, err := s.Get(c)
if err != nil { if err != nil {
return xerrors.Errorf("error retrieving linked block (cid: %s): %w", c, err) return xerrors.Errorf("error retrieving linked block (cid: %s): %w", c, err)