Skip to content

Commit

Permalink
Merge pull request #8 from quorumcontrol/feature/fix-diff
Browse files Browse the repository at this point in the history
length needs to be bigger than the index
  • Loading branch information
tobowers authored Aug 29, 2019
2 parents 61895f4 + 72588c7 commit edd9ec4
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 edd9ec4

Please sign in to comment.