Skip to content

Commit 08e15f8

Browse files
committed
chore: avoid re-validated already validated CIDs
1 parent 58b483a commit 08e15f8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (p V0Builder) Sum(data []byte) (Cid, error) {
3838
if err != nil {
3939
return Undef, err
4040
}
41-
return NewCidV0(hash), nil
41+
return Cid{string(hash)}, nil
4242
}
4343

4444
func (p V0Builder) GetCodec() uint64 {

cid.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ func CidFromBytes(data []byte) (int, Cid, error) {
613613
return 0, Undef, err
614614
}
615615

616-
return 34, NewCidV0(h), nil
616+
return 34, Cid{string(h)}, nil
617617
}
618618

619619
vers, n := binary.Uvarint(data)

0 commit comments

Comments
 (0)