X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdiff%2FDiffEngine.php;h=ce507d7a83c4cad64b4b49fefb2f5c2a79c19ce4;hb=04d1aa3033f40a38d721f7f0e88b5bac440d2869;hp=edf844417e804b415ba4cfdd83a55767758de4a5;hpb=1e1c24d12c94a90442de5af89df393d1042a246a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/diff/DiffEngine.php b/includes/diff/DiffEngine.php index edf844417e..ce507d7a83 100644 --- a/includes/diff/DiffEngine.php +++ b/includes/diff/DiffEngine.php @@ -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 ) { @@ -508,13 +506,13 @@ class DiffEngine { // value_to_add_forward: a 0 or 1 that we add to the start // offset to make it odd/even - if ( ( $M & 1 ) == 1 ) { + if ( $M & 1 ) { $value_to_add_forward = 1; } else { $value_to_add_forward = 0; } - if ( ( $N & 1 ) == 1 ) { + if ( $N & 1 ) { $value_to_add_backward = 1; } else { $value_to_add_backward = 0; @@ -532,7 +530,7 @@ class DiffEngine { $V1[$limit_min_1] = $N; $limit = min( $this->maxDifferences, ceil( ( $N + $M ) / 2 ) ); - if ( ( $delta & 1 ) == 1 ) { + if ( $delta & 1 ) { for ( $d = 0; $d <= $limit; ++$d ) { $start_diag = max( $value_to_add_forward + $start_forward, -$d ); $end_diag = min( $end_forward, $d );