Make WordPress Core

Ticket #41526: 41526.patch

File 41526.patch, 1.4 KB (added by bor0, 8 years ago)
  • Engine/native.php

     
    189189                    continue;
    190190                }
    191191                $matches = $ymatches[$line];
    192                 reset($matches);
    193                 while (list(, $y) = each($matches)) {
     192                foreach ($matches as $y) {
    194193                    if (empty($this->in_seq[$y])) {
    195194                        $k = $this->_lcsPos($y);
    196195                        assert($k > 0);
    197196                        $ymids[$k] = $ymids[$k - 1];
    198197                        break;
    199                     }
    200                 }
    201                 while (list(, $y) = each($matches)) {
    202                     if ($y > $this->seq[$k - 1]) {
     198                    } elseif ($y > $this->seq[$k - 1]) {
    203199                        assert($y <= $this->seq[$k]);
    204                         /* Optimization: this is a common case: next match is
    205                          * just replacing previous match. */
    206200                        $this->in_seq[$this->seq[$k]] = false;
    207201                        $this->seq[$k] = $y;
    208202                        $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];
    213203                    }
    214204                }
    215205            }