"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/gii/components/Pear/Text/Diff/Engine/native.php" between
yii-1.1.19.5790cb.tar.gz and yii-1.1.20.6ed384.tar.gz

About: Yii is a high-performance component-based PHP framework for developing large-scale Web applications. Hint: Yii 1.1 is now in maintenance mode.

native.php  (yii-1.1.19.5790cb):native.php  (yii-1.1.20.6ed384)
skipping to change at line 195 skipping to change at line 195
} }
$x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks); $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks);
for (; $x < $x1; $x++) { for (; $x < $x1; $x++) {
$line = $flip ? $this->yv[$x] : $this->xv[$x]; $line = $flip ? $this->yv[$x] : $this->xv[$x];
if (empty($ymatches[$line])) { if (empty($ymatches[$line])) {
continue; continue;
} }
$matches = $ymatches[$line]; $matches = $ymatches[$line];
reset($matches); reset($matches);
while (list(, $y) = each($matches)) { foreach($matches as $match) {
reset($match);
$y = next($match);
if (empty($this->in_seq[$y])) { if (empty($this->in_seq[$y])) {
$k = $this->_lcsPos($y); $k = $this->_lcsPos($y);
assert($k > 0); assert($k > 0);
$ymids[$k] = $ymids[$k - 1]; $ymids[$k] = $ymids[$k - 1];
break; break;
} }
} }
while (list(, $y) = each($matches)) { foreach($matches as $match) {
reset($match);
$y = next($match);
if ($y > $this->seq[$k - 1]) { if ($y > $this->seq[$k - 1]) {
assert($y <= $this->seq[$k]); assert($y <= $this->seq[$k]);
/* Optimization: this is a common case: next match is /* Optimization: this is a common case: next match is
* just replacing previous match. */ * just replacing previous match. */
$this->in_seq[$this->seq[$k]] = false; $this->in_seq[$this->seq[$k]] = false;
$this->seq[$k] = $y; $this->seq[$k] = $y;
$this->in_seq[$y] = 1; $this->in_seq[$y] = 1;
} elseif (empty($this->in_seq[$y])) { } elseif (empty($this->in_seq[$y])) {
$k = $this->_lcsPos($y); $k = $this->_lcsPos($y);
assert($k > 0); assert($k > 0);
skipping to change at line 335 skipping to change at line 339
* the one at the beginning, but usually it is cleaner to consider the * the one at the beginning, but usually it is cleaner to consider the
* following identical line to be the "change". * following identical line to be the "change".
* *
* This is extracted verbatim from analyze.c (GNU diffutils-2.7). * This is extracted verbatim from analyze.c (GNU diffutils-2.7).
*/ */
function _shiftBoundaries($lines, &$changed, $other_changed) function _shiftBoundaries($lines, &$changed, $other_changed)
{ {
$i = 0; $i = 0;
$j = 0; $j = 0;
assert('count($lines) == count($changed)'); assert(count($lines) == count($changed));
$len = count($lines); $len = count($lines);
$other_len = count($other_changed); $other_len = count($other_changed);
while (1) { while (1) {
/* Scan forward to find the beginning of another run of /* Scan forward to find the beginning of another run of
* changes. Also keep track of the corresponding point in the * changes. Also keep track of the corresponding point in the
* other file. * other file.
* *
* Throughout this code, $i and $j are adjusted together so that * Throughout this code, $i and $j are adjusted together so that
* the first $i elements of $changed and the first $j elements of * the first $i elements of $changed and the first $j elements of
* $other_changed both contain the same number of zeros (unchanged * $other_changed both contain the same number of zeros (unchanged
* lines). * lines).
* *
* Furthermore, $j is always kept so that $j == $other_len or * Furthermore, $j is always kept so that $j == $other_len or
* $other_changed[$j] == false. */ * $other_changed[$j] == false. */
while ($j < $other_len && $other_changed[$j]) { while ($j < $other_len && $other_changed[$j]) {
$j++; $j++;
} }
while ($i < $len && ! $changed[$i]) { while ($i < $len && ! $changed[$i]) {
assert('$j < $other_len && ! $other_changed[$j]'); assert($j < $other_len && ! $other_changed[$j]);
$i++; $j++; $i++; $j++;
while ($j < $other_len && $other_changed[$j]) { while ($j < $other_len && $other_changed[$j]) {
$j++; $j++;
} }
} }
if ($i == $len) { if ($i == $len) {
break; break;
} }
skipping to change at line 388 skipping to change at line 392
/* Move the changed region back, so long as the previous /* Move the changed region back, so long as the previous
* unchanged line matches the last changed one. This merges * unchanged line matches the last changed one. This merges
* with previous changed regions. */ * with previous changed regions. */
while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) { while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) {
$changed[--$start] = 1; $changed[--$start] = 1;
$changed[--$i] = false; $changed[--$i] = false;
while ($start > 0 && $changed[$start - 1]) { while ($start > 0 && $changed[$start - 1]) {
$start--; $start--;
} }
assert('$j > 0'); assert($j > 0);
while ($other_changed[--$j]) { while ($other_changed[--$j]) {
continue; continue;
} }
assert('$j >= 0 && !$other_changed[$j]'); assert($j >= 0 && !$other_changed[$j]);
} }
/* Set CORRESPONDING to the end of the changed run, at the /* Set CORRESPONDING to the end of the changed run, at the
* last point where it corresponds to a changed run in the * last point where it corresponds to a changed run in the
* other file. CORRESPONDING == LEN means no such point has * other file. CORRESPONDING == LEN means no such point has
* been found. */ * been found. */
$corresponding = $j < $other_len ? $i : $len; $corresponding = $j < $other_len ? $i : $len;
/* Move the changed region forward, so long as the first /* Move the changed region forward, so long as the first
* changed line matches the following unchanged one. This * changed line matches the following unchanged one. This
* merges with following changed regions. Do this second, so * merges with following changed regions. Do this second, so
* that if there are no merges, the changed region is moved * that if there are no merges, the changed region is moved
* forward as far as possible. */ * forward as far as possible. */
while ($i < $len && $lines[$start] == $lines[$i]) { while ($i < $len && $lines[$start] == $lines[$i]) {
$changed[$start++] = false; $changed[$start++] = false;
$changed[$i++] = 1; $changed[$i++] = 1;
while ($i < $len && $changed[$i]) { while ($i < $len && $changed[$i]) {
$i++; $i++;
} }
assert('$j < $other_len && ! $other_changed[$j]'); assert($j < $other_len && ! $other_changed[$j]);
$j++; $j++;
if ($j < $other_len && $other_changed[$j]) { if ($j < $other_len && $other_changed[$j]) {
$corresponding = $i; $corresponding = $i;
while ($j < $other_len && $other_changed[$j]) { while ($j < $other_len && $other_changed[$j]) {
$j++; $j++;
} }
} }
} }
} while ($runlength != $i - $start); } while ($runlength != $i - $start);
/* If possible, move the fully-merged run of changes back to a /* If possible, move the fully-merged run of changes back to a
* corresponding run in the other file. */ * corresponding run in the other file. */
while ($corresponding < $i) { while ($corresponding < $i) {
$changed[--$start] = 1; $changed[--$start] = 1;
$changed[--$i] = 0; $changed[--$i] = 0;
assert('$j > 0'); assert($j > 0);
while ($other_changed[--$j]) { while ($other_changed[--$j]) {
continue; continue;
} }
assert('$j >= 0 && !$other_changed[$j]'); assert($j >= 0 && !$other_changed[$j]);
} }
} }
} }
} }
 End of changes. 9 change blocks. 
9 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)