simplify Has
This commit is contained in:
parent
37e391f133
commit
0af7b16ad5
@ -55,12 +55,8 @@ func (s *SplitStore) DeleteBlock(cid cid.Cid) error {
|
|||||||
func (s *SplitStore) Has(cid cid.Cid) (bool, error) {
|
func (s *SplitStore) Has(cid cid.Cid) (bool, error) {
|
||||||
has, err := s.hot.Has(cid)
|
has, err := s.hot.Has(cid)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil || has {
|
||||||
return false, err
|
return has, err
|
||||||
}
|
|
||||||
|
|
||||||
if has {
|
|
||||||
return true, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.cold.Has(cid)
|
return s.cold.Has(cid)
|
||||||
|
Loading…
Reference in New Issue
Block a user