Reverted r101244 changes - these are not equivalent and may have been causing the...
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 9 Nov 2011 22:59:09 +0000 (22:59 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 9 Nov 2011 22:59:09 +0000 (22:59 +0000)
includes/diff/DairikiDiff.php

index 7f618fc..c935eee 100644 (file)
@@ -371,7 +371,7 @@ class _DiffEngine {
                                }
                                $matches = $ymatches[$line];
                                reset( $matches );
-                               foreach ( $matches as $y ) {
+                               while ( list( , $y ) = each( $matches ) ) {
                                        if ( empty( $this->in_seq[$y] ) ) {
                                                $k = $this->_lcs_pos( $y );
                                                assert( $k > 0 );
@@ -379,7 +379,7 @@ class _DiffEngine {
                                                break;
                                        }
                                }
-                               foreach ( $matches as $y ) {
+                               while ( list ( , $y ) = each( $matches ) ) {
                                        if ( $y > $this->seq[$k -1] ) {
                                                assert( $y < $this->seq[$k] );
                                                // Optimization: this is a common case:
@@ -493,7 +493,7 @@ class _DiffEngine {
                        // Use the partitions to split this problem into subproblems.
                        reset( $seps );
                        $pt1 = $seps[0];
-                       foreach ( $seps as $pt2 ) {
+                       while ( $pt2 = next( $seps ) ) {
                                $this->_compareseq ( $pt1[0], $pt2[0], $pt1[1], $pt2[1] );
                                $pt1 = $pt2;
                        }