Skip to content

Commit

Permalink
address code review, add comments
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
  • Loading branch information
whyrusleeping committed May 18, 2017
1 parent 8f97786 commit f326dd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions merkledag/utils/diffenum.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pin/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f326dd8

Please sign in to comment.