From fe831fb78e7c749d52cada2e1871b4c5bf4f0d93 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 17 Dec 2005 05:11:02 +0000 Subject: [PATCH] Removing commented-out debug code and deprecated fetch_diff_extent2() --- includes/svnlib.php | 73 --------------------------------------------- 1 file changed, 73 deletions(-) diff --git a/includes/svnlib.php b/includes/svnlib.php index 282ab57..435afd8 100644 --- a/includes/svnlib.php +++ b/includes/svnlib.php @@ -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); - } } /*=====================================================================*\ -- 2.43.5