Skip to content

Commit 3efed93

Browse files
committed
Fix: Do not use each
1 parent d12474d commit 3efed93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Text/Diff/Engine/native.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,16 @@ function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
192192
}
193193
$matches = $ymatches[$line];
194194
reset($matches);
195-
while (list(, $y) = each($matches)) {
195+
196+
foreach ($matches as list(, $y)) {
196197
if (empty($this->in_seq[$y])) {
197198
$k = $this->_lcsPos($y);
198199
assert($k > 0);
199200
$ymids[$k] = $ymids[$k - 1];
200201
break;
201202
}
202203
}
203-
while (list(, $y) = each($matches)) {
204+
foreach ($matches as list(, $y)) {
204205
if ($y > $this->seq[$k - 1]) {
205206
assert($y <= $this->seq[$k]);
206207
/* Optimization: this is a common case: next match is

0 commit comments

Comments
 (0)