mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-01 14:28:02 +08:00
merkledag: optimize DagService GetLinks for Raw Nodes.
A Raw Node can not possible have links, so there is no need to retrive the node. Once Raw Nodes are in common usage this can likely make a big difference in the GC and other places that just care about the Links. License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
This commit is contained in:
parent
1ca2d42889
commit
bfe7ad7ec3
@ -114,6 +114,9 @@ func decodeBlock(b blocks.Block) (node.Node, error) {
|
||||
}
|
||||
|
||||
func (n *dagService) GetLinks(ctx context.Context, c *cid.Cid) ([]*node.Link, error) {
|
||||
if c.Type() == cid.Raw {
|
||||
return nil, nil
|
||||
}
|
||||
node, err := n.Get(ctx, c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Loading…
Reference in New Issue
Block a user