xdiff : remove not needed code
xdiff : update tests to add Exception tests git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4313 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
28
xdiff.php
28
xdiff.php
@@ -196,13 +196,6 @@ class xdiff
|
||||
if (empty ($chunk1) && ! empty ($chunk2))
|
||||
{
|
||||
// APPEND
|
||||
while ($j < count ($array2))
|
||||
{
|
||||
if ($array2[$j] === $lcs)
|
||||
break;
|
||||
$chunk2[] = $array2[$j];
|
||||
$j++;
|
||||
}
|
||||
$diff[] = array ("type" => "Append",
|
||||
"startLine1" => $i,
|
||||
"endLine1" => $i,
|
||||
@@ -214,13 +207,6 @@ class xdiff
|
||||
elseif (! empty ($chunk1) && empty ($chunk2))
|
||||
{
|
||||
// DELETE
|
||||
while ($i < count ($array1))
|
||||
{
|
||||
if ($array1[$i] === $lcs)
|
||||
break;
|
||||
$chunk1[] = $array1[$i];
|
||||
$i++;
|
||||
}
|
||||
$diff[] = array ("type" => "Delete",
|
||||
"startLine1" => 1 + $i - count ($chunk1),
|
||||
"endLine1" => $i,
|
||||
@@ -232,20 +218,6 @@ class xdiff
|
||||
else
|
||||
{
|
||||
// CHANGE ON BOTH ARRAY
|
||||
while ($i < count ($array1))
|
||||
{
|
||||
if ($array1[$i] === $lcs)
|
||||
break;
|
||||
$chunk1[] = $array1[$i];
|
||||
$i++;
|
||||
}
|
||||
while ($j < count ($array2))
|
||||
{
|
||||
if ($array2[$j] === $lcs)
|
||||
break;
|
||||
$chunk2[] = $array2[$j];
|
||||
$j++;
|
||||
}
|
||||
$diff[] = array ("type" => "Change",
|
||||
"startLine1" => 1 + $i - count ($chunk1),
|
||||
"endLine1" => $i,
|
||||
|
||||
Reference in New Issue
Block a user