Removing commented-out debug code and deprecated fetch_diff_extent2()
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 17 Dec 2005 05:11:02 +0000 (05:11 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 17 Dec 2005 05:11:02 +0000 (05:11 +0000)
includes/svnlib.php

index 282ab575df8ee5789f9c302adf8e9b4f4e71a04d..435afd8191a4fdc4892f6873100f133a8c720928 100644 (file)
@@ -871,14 +871,12 @@ class SVNDiff
                        
                        if ($indexcounter <= 3 AND $indexcounter !== null)
                        {
-                               //echo $line . "\n";
                                $indexcounter++;
                                continue;
                        }
                        else if ($indexcounter == 3)
                        {
                                $indexcounter = null;
-                               //echo "\n\n\n";
                                continue;
                        }
                        
@@ -907,9 +905,6 @@ class SVNDiff
                                                
                                                if ($delta = @$this->fetch_diff_extent($lastline['line'], $content))
                                                {
-                                                       //$delta['end'] = $delta['start'] + -$delta['end'];
-                                                       //print_r($delta);
-                                                       //$change = '';
                                                        if (strlen($lastline['line']) > ($delta['start'] - $delta['end']))
                                                        {
                                                                $end = strlen($lastline['line']) + $delta['end'];
@@ -918,7 +913,6 @@ class SVNDiff
                                                                $this->diff["$index"]["$chunk"]["$lastline[INDEX]"]['line'] = substr($lastline['line'], 0, $delta['start']) . $change . substr($lastline['line'], $end);
                                                        }
                                                        
-                                                       //$change = '';
                                                        if (strlen($content) > $delta['start'] - $delta['end'])
                                                        {
                                                                $end = strlen($content) + $delta['end'];
@@ -926,25 +920,6 @@ class SVNDiff
                                                                $change = '{@+' . '+}' . substr($content, $delta['start'], $end - $delta['start']) . '{/@+' . '+}';
                                                                $content = substr($content, 0, $delta['start']) . $change . substr($content, $end);
                                                        }
-                                                       
-                                                       // create two sets of ends for the two contents
-                                                       /*$delta['endo'] = strlen($lastline['line']) - $delta['end'];
-                                                       $delta['endn'] = strlen($content) - $delta['end'];
-                                                       
-                                                       $diffo = $delta['endo'] - $delta['start'];
-                                                       $diffn = $delta['endn'] - $delta['start'];
-                                                       
-                                                       if (strlen($lastline['line']) > $delta['endo'] - $diffo)
-                                                       {
-                                                               $removed = substr($lastline['line'], $delta['start'], $diffo);
-                                                               $this->diff["$index"]["$chunk"]["$lastline[INDEX]"]['line'] = substr_replace($lastline['line'], '{@-' . '-}' . $removed . '{/@-' . '-}', $delta['start'], $diffo);
-                                                       }
-                                                       
-                                                       if (strlen($content) > $delta['endn'] - $diffn)
-                                                       {
-                                                               $added = substr($content, $delta['start'], $diffn);
-                                                               $content = substr_replace($content, '{@+' . '+}' . $added . '{/@+' . '+}', $delta['start'], $diffn);
-                                                       }*/
                                                }
                                        }
                                        
@@ -1032,54 +1007,6 @@ class SVNDiff
                
                return array('start' => $start, 'end' => $end + 1, 'min' => $min);
        }
-       
-       /**
-       * Returns the amount of change that occured
-       * between two lines
-       *
-       * @access       private
-       * @deprecated   Use the fetch_diff_extent() function; this one calculates incorrect end deltas
-       *
-       * @param        string  Old line
-       * @param        string  New line
-       *
-       * @return       array   Difference of positions
-       */
-       function fetch_diff_extent2($old, $new)
-       {
-               $start = 0;
-               $min = min(strlen($old), strlen($new));
-               
-               for ($start = 0; $start < $min; $start++)
-               {
-                       if ($old{"$start"} != $new{"$start"})
-                       {
-                               break;
-                       }
-               }
-               
-               $max = max(strlen($old), strlen($new));
-               
-               for ($end = 0; $end < $min; $end++)
-               {
-                       $oldpos = strlen($old) - $end;
-                       $newpos = strlen($new) - $end;
-                       
-                       if ($old{"$oldpos"} != $new{"$newpos"})
-                       {
-                               break;
-                       }
-               }
-               
-               $end--;
-               
-               if ($start == 0 AND $end == $max)
-               {
-                       return false;
-               }
-               
-               return array('start' => $start, 'end' => $end);
-       }
 }
 
 /*=====================================================================*\