Make WordPress Core

Ticket #41526: 41526.3.patch

File 41526.3.patch, 1.3 KB (added by johnbillion, 7 years ago)
  • src/wp-includes/Text/Diff/Engine/native.php

    diff --git a/src/wp-includes/Text/Diff/Engine/native.php b/src/wp-includes/Text/Diff/Engine/native.php
    index e908cfecca..bae2c1a288 100644
    a b class Text_Diff_Engine_native { 
    190190                }
    191191                $matches = $ymatches[$line];
    192192                reset($matches);
    193                 while (list(, $y) = each($matches)) {
     193                while ($y = current($matches)) {
    194194                    if (empty($this->in_seq[$y])) {
    195195                        $k = $this->_lcsPos($y);
    196196                        assert($k > 0);
    197197                        $ymids[$k] = $ymids[$k - 1];
    198198                        break;
    199199                    }
     200                    next($matches);
    200201                }
    201                 while (list(, $y) = each($matches)) {
     202                while ($y = current($matches)) {
    202203                    if ($y > $this->seq[$k - 1]) {
    203204                        assert($y <= $this->seq[$k]);
    204205                        /* Optimization: this is a common case: next match is
    class Text_Diff_Engine_native { 
    211212                        assert($k > 0);
    212213                        $ymids[$k] = $ymids[$k - 1];
    213214                    }
     215                    next($matches);
    214216                }
    215217            }
    216218        }