708
709
if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {
710
>
// We can't finish, so skip ahead to generating a result from what we have.
diff.ts
711
>
quitEarlyArr[0] = true;
712
>
713
>
// Use the furthest distance we got in the forward direction.
714
>
midOriginalArr[0] = furthestOriginalIndex;
715
>
midModifiedArr[0] = furthestModifiedIndex;
716
>
717
>
if (matchLengthOfLongest > 0 && LocalConstants.MaxDifferencesHistory > 0 && numDifferences <= (LocalConstants.MaxDifferencesHistory + 1)) {
718
>
// Enough of the history is in memory to walk it backwards
719
>
return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,
720
>
diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,
721
>
forwardPoints, reversePoints,
722
>
originalIndex, originalEnd, midOriginalArr,
723
>
modifiedIndex, modifiedEnd, midModifiedArr,
724
>
deltaIsEven, quitEarlyArr
725
>
);
726
>
} else {
727
>
// We didn't actually remember enough of the history.
728
>
729
>
//Since we are quitting the diff early, we need to shift back the originalStart and modified start
730
>
//back into the boundary limits since we decremented their value above beyond the boundary limit.
731
>
originalStart++;
732
>
modifiedStart++;
733
>
734
>
return [
735
>
new DiffChange(originalStart, originalEnd - originalStart + 1,
736
>
modifiedStart, modifiedEnd - modifiedStart + 1)
737
>
];
738
>
}
739
>
}
740
741
// Run the algorithm in the reverse direction