Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
polish: remove redundant cid Defined check
Browse files Browse the repository at this point in the history
  • Loading branch information
frrist committed May 4, 2021
1 parent b34f205 commit 9d57a70
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions arc_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ func (b *arccache) View(k cid.Cid, callback func([]byte) error) error {
return callback(blk.RawData())
}

if !k.Defined() {
log.Error("undefined cid in arc cache")
return ErrNotFound
}

if has, _, ok := b.queryCache(k); ok && !has {
// short circuit if the cache deterministically tells us the item
// doesn't exist.
Expand All @@ -145,11 +140,6 @@ func (b *arccache) View(k cid.Cid, callback func([]byte) error) error {
}

func (b *arccache) Get(k cid.Cid) (blocks.Block, error) {
if !k.Defined() {
log.Error("undefined cid in arc cache")
return nil, ErrNotFound
}

if has, _, ok := b.queryCache(k); ok && !has {
return nil, ErrNotFound
}
Expand Down

0 comments on commit 9d57a70

Please sign in to comment.