Skip to content

Commit

Permalink
incorrect length comparison, length needs to be bigger than the index…
Browse files Browse the repository at this point in the history
… you are looking for
  • Loading branch information
tobowers committed Aug 29, 2019
1 parent 61895f4 commit 72588c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion differ/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func FindNew(ctx context.Context, cs *hamt.CborIpldStore, existingHamt *hamt.Nod
func getDiffFromNodes(ctx context.Context, cs *hamt.CborIpldStore, existingHamt *hamt.Node, newHamt *hamt.Node) ([]*pb.KV, error) {
newPairs := make([]*pb.KV, 0)
for i, pointer := range newHamt.Pointers {
if len(existingHamt.Pointers) > 0 && len(existingHamt.Pointers) < i {
if len(existingHamt.Pointers) > 0 && len(existingHamt.Pointers) > i {
existingPointer := existingHamt.Pointers[i]
if !pointer.Link().Defined() && pointer.Link().Equals(existingPointer.Link()) {
continue // the links are the same, just continue
Expand Down

0 comments on commit 72588c7

Please sign in to comment.