Class used internally by Diff to actually compute the diffs.
The algorithm used here is mostly lifted from the perl module Algorithm::Diff (version 1.06) by Ned Konz, which is available at: http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip
More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html
Some ideas (and a bit of code) are from analyze.c, from GNU diffutils-2.7, which can be found at: ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz
closingly, some ideas (subdivision by NCHUNKS > 2, and some optimizations) are my own.
Line length limits for robustness added by Tim Starling, 2005-08-31 Alternative implementation added by Guy Van den Broeck, 2008-07-30
- Author
- Geoffrey T. Dairiki, Tim Starling, Guy Van den Broeck
- Access:\n private
Definition at line 218 of file DairikiDiff.php.
DiffEngine::shiftBoundaries |
( |
|
$lines, |
|
|
& |
$changed, |
|
|
|
$other_changed |
|
) |
| |
|
private |
Adjust inserts/deletes of identical lines to join changes as much as possible.
We do something when a run of changed lines include a line at one end and has an excluded, identical line at the other. We are free to choose which identical line is included. ‘compareseq’ usually chooses the one at the beginning, but usually it is cleaner to consider the following identical line to be the "change".
This is extracted verbatim from analyze.c (GNU diffutils-2.7).
Definition at line 314 of file DairikiDiff.php.
References $i, and $lines.
Referenced by diff().