Ticket #41526: 41526.2.patch
File 41526.2.patch, 3.2 KB (added by , 7 years ago) |
---|
-
src/wp-includes/Text/Diff/Engine/native.php
190 190 } 191 191 $matches = $ymatches[$line]; 192 192 reset($matches); 193 while ( list(, $y) = each($matches)) {193 while ($y = current($matches)) { 194 194 if (empty($this->in_seq[$y])) { 195 195 $k = $this->_lcsPos($y); 196 196 assert($k > 0); … … 197 197 $ymids[$k] = $ymids[$k - 1]; 198 198 break; 199 199 } 200 next($matches); 200 201 } 201 while ( list(, $y) = each($matches)) {202 while ($y = current($matches)) { 202 203 if ($y > $this->seq[$k - 1]) { 203 204 assert($y <= $this->seq[$k]); 204 205 /* Optimization: this is a common case: next match is … … 211 212 assert($k > 0); 212 213 $ymids[$k] = $ymids[$k - 1]; 213 214 } 215 next($matches); 214 216 } 215 217 } 216 218 } … … 330 332 $i = 0; 331 333 $j = 0; 332 334 333 assert( 'count($lines) == count($changed)');335 assert(count($lines) == count($changed)); 334 336 $len = count($lines); 335 337 $other_len = count($other_changed); 336 338 … … 351 353 } 352 354 353 355 while ($i < $len && ! $changed[$i]) { 354 assert( '$j < $other_len && ! $other_changed[$j]');356 assert($j < $other_len && ! $other_changed[$j]); 355 357 $i++; $j++; 356 358 while ($j < $other_len && $other_changed[$j]) { 357 359 $j++; … … 383 385 while ($start > 0 && $changed[$start - 1]) { 384 386 $start--; 385 387 } 386 assert( '$j > 0');388 assert($j > 0); 387 389 while ($other_changed[--$j]) { 388 390 continue; 389 391 } 390 assert( '$j >= 0 && !$other_changed[$j]');392 assert($j >= 0 && !$other_changed[$j]); 391 393 } 392 394 393 395 /* Set CORRESPONDING to the end of the changed run, at the … … 408 410 $i++; 409 411 } 410 412 411 assert( '$j < $other_len && ! $other_changed[$j]');413 assert($j < $other_len && ! $other_changed[$j]); 412 414 $j++; 413 415 if ($j < $other_len && $other_changed[$j]) { 414 416 $corresponding = $i; … … 424 426 while ($corresponding < $i) { 425 427 $changed[--$start] = 1; 426 428 $changed[--$i] = 0; 427 assert( '$j > 0');429 assert($j > 0); 428 430 while ($other_changed[--$j]) { 429 431 continue; 430 432 } 431 assert( '$j >= 0 && !$other_changed[$j]');433 assert($j >= 0 && !$other_changed[$j]); 432 434 } 433 435 } 434 436 }