Skip to content

Commit 7f76018

Browse files
xuxinkuntamalsaha
authored andcommitted
fix bug to avoid out of range error. (#22)
1 parent 7c0e3b2 commit 7f76018

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jsonpatch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ func backtrace(s, t []interface{}, p string, i int, j int, matrix [][]int) []Ope
326326
return append([]Operation{op}, backtrace(s, t, p, i-1, j-1, matrix)...)
327327
}
328328

329-
p2, _ := handleValues(s[j-1], t[j-1], makePath(p, i-1), []Operation{})
329+
p2, _ := handleValues(s[i-1], t[j-1], makePath(p, i-1), []Operation{})
330330
return append(p2, backtrace(s, t, p, i-1, j-1, matrix)...)
331331
}
332332
if i > 0 && j > 0 && matrix[i-1][j-1] == matrix[i][j] {

0 commit comments

Comments
 (0)