From 9d57a70f9ec81190a1a02a710e8ea940b38be4de Mon Sep 17 00:00:00 2001 From: frrist Date: Tue, 4 May 2021 13:21:36 -0700 Subject: [PATCH] polish: remove redundant cid Defined check --- arc_cache.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/arc_cache.go b/arc_cache.go index 2d3c45c..6166b95 100644 --- a/arc_cache.go +++ b/arc_cache.go @@ -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. @@ -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 }