Make WordPress Core

Ticket #41526: 41526.2.patch

File 41526.2.patch, 3.2 KB (added by SergeyBiryukov, 7 years ago)
  • src/wp-includes/Text/Diff/Engine/native.php

     
    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
     
    211212                        assert($k > 0);
    212213                        $ymids[$k] = $ymids[$k - 1];
    213214                    }
     215                    next($matches);
    214216                }
    215217            }
    216218        }
     
    330332        $i = 0;
    331333        $j = 0;
    332334
    333         assert('count($lines) == count($changed)');
     335        assert(count($lines) == count($changed));
    334336        $len = count($lines);
    335337        $other_len = count($other_changed);
    336338
     
    351353            }
    352354
    353355            while ($i < $len && ! $changed[$i]) {
    354                 assert('$j < $other_len && ! $other_changed[$j]');
     356                assert($j < $other_len && ! $other_changed[$j]);
    355357                $i++; $j++;
    356358                while ($j < $other_len && $other_changed[$j]) {
    357359                    $j++;
     
    383385                    while ($start > 0 && $changed[$start - 1]) {
    384386                        $start--;
    385387                    }
    386                     assert('$j > 0');
     388                    assert($j > 0);
    387389                    while ($other_changed[--$j]) {
    388390                        continue;
    389391                    }
    390                     assert('$j >= 0 && !$other_changed[$j]');
     392                    assert($j >= 0 && !$other_changed[$j]);
    391393                }
    392394
    393395                /* Set CORRESPONDING to the end of the changed run, at the
     
    408410                        $i++;
    409411                    }
    410412
    411                     assert('$j < $other_len && ! $other_changed[$j]');
     413                    assert($j < $other_len && ! $other_changed[$j]);
    412414                    $j++;
    413415                    if ($j < $other_len && $other_changed[$j]) {
    414416                        $corresponding = $i;
     
    424426            while ($corresponding < $i) {
    425427                $changed[--$start] = 1;
    426428                $changed[--$i] = 0;
    427                 assert('$j > 0');
     429                assert($j > 0);
    428430                while ($other_changed[--$j]) {
    429431                    continue;
    430432                }
    431                 assert('$j >= 0 && !$other_changed[$j]');
     433                assert($j >= 0 && !$other_changed[$j]);
    432434            }
    433435        }
    434436    }