X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdiff%2FDiffEngine.php;h=546a12cb79aa813122efb4c3f87724143d8993ea;hb=4d75fbf3571c765a3d84140cb77b45a86aab3184;hp=273d1d61f6fc07c7a2ae3dc14a58a992a441a1b2;hpb=570267e1bde94c9e7d49261ce2a0ef4fa7ac52b0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/diff/DiffEngine.php b/includes/diff/DiffEngine.php index 273d1d61f6..546a12cb79 100644 --- a/includes/diff/DiffEngine.php +++ b/includes/diff/DiffEngine.php @@ -351,7 +351,7 @@ class DiffEngine { $this->maxDifferences = ceil( ( $this->m + $this->n ) / 2.0 ); if ( $this->m * $this->n > $this->tooLong ) { // limit complexity to D^POW_LIMIT for long sequences - $this->maxDifferences = floor( pow( $this->maxDifferences, $this->powLimit - 1.0 ) ); + $this->maxDifferences = floor( $this->maxDifferences ** ( $this->powLimit - 1.0 ) ); wfDebug( "Limiting max number of differences to $this->maxDifferences\n" ); } @@ -456,9 +456,7 @@ class DiffEngine { // need to store these so we don't lose them when they're // overwritten by the recursion - $len = $snake[2]; - $startx = $snake[0]; - $starty = $snake[1]; + list( $startx, $starty, $len ) = $snake; // the middle snake is part of the LCS, store it for ( $i = 0; $i < $len; ++$i ) { @@ -805,40 +803,3 @@ class DiffEngine { } } - -/** - * Alternative representation of a set of changes, by the index - * ranges that are changed. - * - * @ingroup DifferenceEngine - */ -class RangeDifference { - - /** @var int */ - public $leftstart; - - /** @var int */ - public $leftend; - - /** @var int */ - public $leftlength; - - /** @var int */ - public $rightstart; - - /** @var int */ - public $rightend; - - /** @var int */ - public $rightlength; - - function __construct( $leftstart, $leftend, $rightstart, $rightend ) { - $this->leftstart = $leftstart; - $this->leftend = $leftend; - $this->leftlength = $leftend - $leftstart; - $this->rightstart = $rightstart; - $this->rightend = $rightend; - $this->rightlength = $rightend - $rightstart; - } - -}