Skip to content

Commit b9f8b69

Browse files
committed
Fix one more differ direct comparison (through in_array)
1 parent 22d5d14 commit b9f8b69

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

run-tests.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -3982,11 +3982,11 @@ public function diffToArray(array $from, array $to): array
39823982
reset($to);
39833983

39843984
foreach ($common as $token) {
3985-
while (!($this->isEqual)($fromToken = reset($from), $token)) {
3985+
while (!($this->isEqual)(reset($from), $token)) {
39863986
$diff[] = [array_shift($from), self::REMOVED, $fromLine++];
39873987
}
39883988

3989-
while (!($this->isEqual)($toToken = reset($to), $token)) {
3989+
while (!($this->isEqual)($token, reset($to))) {
39903990
$diff[] = [array_shift($to), self::ADDED, $toLine++];
39913991
}
39923992

@@ -4065,8 +4065,10 @@ public function calculateCommonSubsequence(array $from, array $to): array
40654065
}
40664066

40674067
if ($cFrom === 1) {
4068-
if (in_array($from[0], $to, true)) {
4069-
return [$from[0]];
4068+
foreach ($to as $toV) {
4069+
if (($this->isEqual)($from[0], $toV)) {
4070+
return [$from[0]];
4071+
}
40704072
}
40714073

40724074
return [];

0 commit comments

Comments
 (0)