Skip to content

Commit c61a2a4

Browse files
Remove incorrect swapping code from diffseq()
Here, m and n are accessed before being initialized, and so a and b are never swapped. Swapping a and b for computing a diff is correct (but useless) for computing the Longest Common Subsequence, but incorrect for computing diffs, so remove this code.
1 parent 01f6a85 commit c61a2a4

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

json-diff.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ var json_diff = (function() {
8989
row = [], c = [],
9090
left, diag, latch;
9191

92-
//make sure shorter sequence is the column sequence
93-
if (m < n) {
94-
var swap = a;
95-
a = b;
96-
b = swap;
97-
}
9892
m = a.length;
9993
n = b.length;
10094

0 commit comments

Comments
 (0)