Skip to content

Commit a335da9

Browse files
authored
Merge pull request #7 from localheinz/fix/each
Fix: Do not use `each()`
2 parents d12474d + 14a7007 commit a335da9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Text/Diff/Engine/native.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,15 @@ function _diag ($xoff, $xlim, $yoff, $ylim, $nchunks)
192192
}
193193
$matches = $ymatches[$line];
194194
reset($matches);
195-
while (list(, $y) = each($matches)) {
195+
foreach ($matches as list(, $y)) {
196196
if (empty($this->in_seq[$y])) {
197197
$k = $this->_lcsPos($y);
198198
assert($k > 0);
199199
$ymids[$k] = $ymids[$k - 1];
200200
break;
201201
}
202202
}
203-
while (list(, $y) = each($matches)) {
203+
foreach ($matches as list(, $y)) {
204204
if ($y > $this->seq[$k - 1]) {
205205
assert($y <= $this->seq[$k]);
206206
/* Optimization: this is a common case: next match is

0 commit comments

Comments
 (0)