提交 8f8020e8 作者: Mildred Ki'Lya 提交者: Shanti Bouchez-Mongardé

merkledag: Remove cached Node.node

License: MIT
Signed-off-by: 's avatarMildred Ki'Lya <mildred-pub.git@mildred.fr>
上级 b3c9922c
......@@ -48,9 +48,6 @@ type Link struct {
// multihash of the target object
Hash mh.Multihash
// a ptr to the actual node for graph manipulation
node *Node
}
type LinkSlice []*Link
......@@ -78,10 +75,6 @@ func MakeLink(n *Node) (*Link, error) {
// GetNode returns the MDAG Node that this link points to
func (l *Link) GetNode(ctx context.Context, serv DAGService) (*Node, error) {
if l.node != nil {
return l.node, nil
}
return serv.Get(ctx, key.Key(l.Hash))
}
......@@ -92,7 +85,6 @@ func (n *Node) AddNodeLink(name string, that *Node) error {
lnk, err := MakeLink(that)
lnk.Name = name
lnk.node = that
if err != nil {
return err
}
......@@ -122,7 +114,6 @@ func (n *Node) AddRawLink(name string, l *Link) error {
Name: name,
Size: l.Size,
Hash: l.Hash,
node: l.node,
})
return nil
......@@ -158,7 +149,6 @@ func (n *Node) GetNodeLink(name string) (*Link, error) {
Name: l.Name,
Size: l.Size,
Hash: l.Hash,
node: l.node,
}, nil
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论