diff --git a/merkledag/utils/diffenum.go b/merkledag/utils/diffenum.go index bc7e09321207..f135281447a8 100644 --- a/merkledag/utils/diffenum.go +++ b/merkledag/utils/diffenum.go @@ -55,13 +55,15 @@ func DiffEnumerate(ctx context.Context, dserv node.NodeGetter, from, to *cid.Cid return nil } +// if both bef and aft are not nil, then that signifies bef was replaces with aft. +// if bef is nil and aft is not, that means aft was newly added +// if aft is nil and bef is not, that means bef was deleted type diffpair struct { bef, aft *cid.Cid } -// getLinkDiff returns a changset (minimum edit distance style) between nodes -// 'a' and 'b'. Currently does not log deletions as our usecase doesnt call for -// this. +// getLinkDiff returns a changeset between nodes 'a' and 'b'. Currently does +// not log deletions as our usecase doesnt call for this. func getLinkDiff(a, b node.Node) []diffpair { have := make(map[string]*node.Link) names := make(map[string]*node.Link) diff --git a/pin/pin.go b/pin/pin.go index 8de1780f09cb..482d070fd50f 100644 --- a/pin/pin.go +++ b/pin/pin.go @@ -90,7 +90,7 @@ type Pinner interface { // Update updates a recursive pin from one cid to another // this is more efficient than simply pinning the new one and unpinning the // old one - Update(context.Context, *cid.Cid, *cid.Cid, bool) error + Update(ctx context.Context, from, to *cid.Cid, unpin bool) error // Check if a set of keys are pinned, more efficient than // calling IsPinned for each key