Skip to content

Commit

Permalink
fix: skip traversal of links with the same cid (#76)
Browse files Browse the repository at this point in the history
* fix: skip traversal of links with the same cid

* fix non-parallel version
  • Loading branch information
birdychang committed May 11, 2023
1 parent fab6283 commit ecc4261
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ func diffNode(ctx context.Context, prevCtx, curCtx *nodeContext, prev, cur *node
}

// Both previous and current have links to diff
if prev.links[i].cid == cur.links[i].cid {
continue
}

prevSubCtx := &nodeContext{
bs: prevCtx.bs,
Expand Down
3 changes: 3 additions & 0 deletions diff_parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ func (s *diffScheduler) work(ctx context.Context, todo *task, results chan *Chan
}

// Both previous and current have links to diff
if prev.links[i].cid == cur.links[i].cid {
continue
}

prevSubCtx := &nodeContext{
bs: prevCtx.bs,
Expand Down

0 comments on commit ecc4261

Please sign in to comment.