fge/json-patch — pull request #12 by rwatler (2014-04-18 06:44:50+00:00)
Title: Issue #11 patch on refactored branch/code line

Correct 'removeRemaining()' Diff creation from postLCS(): set secondArrayIndex used by array diffs to remove index, (which is the second array length in this case).

The comment in the original Diff.tailArrayRemove() code was incorrect: the Diff.secondArrayIndex is used to generate array difference/patch objects. This patch ensures that is set correctly. Because these are removes at the tail, we know that the secondArrayIndex will be equal to the length of the second array... .as if we were removing all elements that were in that position when the patch would be applied to ensure that the second array ends up at that length when done.