Skip to content

Commit

Permalink
Slight change to the delta algorithm (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmetais authored Aug 27, 2016
1 parent 9b67c32 commit 6d5e981
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/deltaApplier.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ var DeltaApplier = function() {

if (adding) {
newString += chunks[3];
charIndex += chunks[3].length;
} else {
// Removing
numberOfCharsToRemove = parseInt(chunks[3], 10);
deletedChars += numberOfCharsToRemove;
oldStringCursor += numberOfCharsToRemove;
charIndex += numberOfCharsToRemove;
}
}

Expand Down

0 comments on commit 6d5e981

Please sign in to comment.