Commit 7ab5f1f6 authored by Mildred Ki'Lya's avatar Mildred Ki'Lya

path/resolver.go: simplify ResolveLinks()

License: MIT
Signed-off-by: default avatarMildred Ki'Lya <mildred-pub.git@mildred.fr>
parent da9cdfdc
...@@ -90,21 +90,6 @@ func (l *Link) GetNode(ctx context.Context, serv DAGService) (*Node, error) { ...@@ -90,21 +90,6 @@ func (l *Link) GetNode(ctx context.Context, serv DAGService) (*Node, error) {
return serv.Get(ctx, key.Key(l.Hash)) return serv.Get(ctx, key.Key(l.Hash))
} }
// GetNodeAndCache return the MDAG Node that the link points to and store a
// pointer to that node along with the link to speed up further retrivals. A
// timeout is to be specified to avoid taking too much time.
func (l *Link) GetNodeAndCache(ctx context.Context, serv DAGService) (*Node, error) {
if l.node == nil {
nd, err := serv.Get(ctx, key.Key(l.Hash))
if err != nil {
return nil, err
}
l.node = nd
}
return l.node, nil
}
// AddNodeLink adds a link to another node. // AddNodeLink adds a link to another node.
func (n *Node) AddNodeLink(name string, that *Node) error { func (n *Node) AddNodeLink(name string, that *Node) error {
n.encoded = nil n.encoded = nil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment