]> git.sesse.net Git - remoteglot/commitdiff
Backport a JSON_delta fix that would cause deletions to go in the wrong order, causin...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Jan 2018 11:20:15 +0000 (12:20 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Jan 2018 11:20:15 +0000 (12:20 +0100)
www/js/json_delta.js

index dad457b527204c9e86a196dd7a24346fbf4fb81a..91b17e1c11344790a8a9b144a8612780ecb24ae1 100644 (file)
@@ -76,7 +76,7 @@ JSON_delta = {
        if (diff.length == 0) {return [[], diff]}
        diff.sort(function (a,b) {return b.length-a.length});
        for (idx in diff) {
-           if (diff[idx] > 1) {break}
+           if (diff[idx].length === 1) {break}
        }
        return [diff.slice(0,idx), diff.slice(idx)]
     },