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

Commit 9d57a70

Browse files
committed
polish: remove redundant cid Defined check
1 parent b34f205 commit 9d57a70

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

arc_cache.go

-10
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ func (b *arccache) View(k cid.Cid, callback func([]byte) error) error {
127127
return callback(blk.RawData())
128128
}
129129

130-
if !k.Defined() {
131-
log.Error("undefined cid in arc cache")
132-
return ErrNotFound
133-
}
134-
135130
if has, _, ok := b.queryCache(k); ok && !has {
136131
// short circuit if the cache deterministically tells us the item
137132
// doesn't exist.
@@ -145,11 +140,6 @@ func (b *arccache) View(k cid.Cid, callback func([]byte) error) error {
145140
}
146141

147142
func (b *arccache) Get(k cid.Cid) (blocks.Block, error) {
148-
if !k.Defined() {
149-
log.Error("undefined cid in arc cache")
150-
return nil, ErrNotFound
151-
}
152-
153143
if has, _, ok := b.queryCache(k); ok && !has {
154144
return nil, ErrNotFound
155145
}

0 commit comments

Comments
 (0)