[ticket/16277] Adjust patch for the diff engine

PHPBB3-16277
This commit is contained in:
rxu 2019-12-30 21:27:12 +07:00
parent 80de9f6a68
commit 374dc92e8f
No known key found for this signature in database
GPG key ID: 955F0567380E586A

View file

@ -287,6 +287,7 @@ class diff_engine
reset($matches);
while ($y = current($matches))
{
next($matches);
if (empty($this->in_seq[$y]))
{
$k = $this->_lcs_pos($y);
@ -298,6 +299,7 @@ class diff_engine
// no reset() here
while ($y = current($matches))
{
next($matches);
if ($y > $this->seq[$k - 1])
{
// Optimization: this is a common case: next match is just replacing previous match.