Changeset 42022 for trunk/src/wp-includes/Text/Diff/Engine/native.php
- Timestamp:
- 10/25/2017 09:55:39 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/Text/Diff/Engine/native.php
r41633 r42022 19 19 * code was written by him, and is used/adapted with his permission. 20 20 * 21 * Copyright 2004-201 7 Horde LLC(http://www.horde.org/)21 * Copyright 2004-2010 The Horde Project (http://www.horde.org/) 22 22 * 23 23 * See the enclosed file COPYING for license information (LGPL). If you did 24 * not receive this file, see http:// www.horde.org/licenses/lgpl21.24 * not receive this file, see http://opensource.org/licenses/lgpl-license.php. 25 25 * 26 26 * @author Geoffrey T. Dairiki <dairiki@dairiki.org> … … 190 190 } 191 191 $matches = $ymatches[$line]; 192 foreach ($matches as $y) { 192 reset($matches); 193 while (list(, $y) = each($matches)) { 193 194 if (empty($this->in_seq[$y])) { 194 195 $k = $this->_lcsPos($y); … … 196 197 $ymids[$k] = $ymids[$k - 1]; 197 198 break; 198 } elseif ($y > $this->seq[$k - 1]) { 199 } 200 } 201 while (list(, $y) = each($matches)) { 202 if ($y > $this->seq[$k - 1]) { 199 203 assert($y <= $this->seq[$k]); 204 /* Optimization: this is a common case: next match is 205 * just replacing previous match. */ 200 206 $this->in_seq[$this->seq[$k]] = false; 201 207 $this->seq[$k] = $y; 202 208 $this->in_seq[$y] = 1; 209 } elseif (empty($this->in_seq[$y])) { 210 $k = $this->_lcsPos($y); 211 assert($k > 0); 212 $ymids[$k] = $ymids[$k - 1]; 203 213 } 204 214 } … … 321 331 $j = 0; 322 332 323 assert( count($lines) == count($changed));333 assert('count($lines) == count($changed)'); 324 334 $len = count($lines); 325 335 $other_len = count($other_changed); … … 342 352 343 353 while ($i < $len && ! $changed[$i]) { 344 assert( $j < $other_len && ! $other_changed[$j]);354 assert('$j < $other_len && ! $other_changed[$j]'); 345 355 $i++; $j++; 346 356 while ($j < $other_len && $other_changed[$j]) { … … 374 384 $start--; 375 385 } 376 assert( $j > 0);386 assert('$j > 0'); 377 387 while ($other_changed[--$j]) { 378 388 continue; 379 389 } 380 assert( $j >= 0 && !$other_changed[$j]);390 assert('$j >= 0 && !$other_changed[$j]'); 381 391 } 382 392 … … 399 409 } 400 410 401 assert( $j < $other_len && ! $other_changed[$j]);411 assert('$j < $other_len && ! $other_changed[$j]'); 402 412 $j++; 403 413 if ($j < $other_len && $other_changed[$j]) { … … 415 425 $changed[--$start] = 1; 416 426 $changed[--$i] = 0; 417 assert( $j > 0);427 assert('$j > 0'); 418 428 while ($other_changed[--$j]) { 419 429 continue; 420 430 } 421 assert( $j >= 0 && !$other_changed[$j]);431 assert('$j >= 0 && !$other_changed[$j]'); 422 432 } 423 433 }
Note: See TracChangeset
for help on using the changeset viewer.