mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Extra optimization for Set::diff(). Refer commit fde10b1
.
This commit is contained in:
parent
59a4732eb8
commit
a89d9e4830
1 changed files with 2 additions and 1 deletions
|
@ -790,11 +790,12 @@ class Set {
|
||||||
return (array)$val1;
|
return (array)$val1;
|
||||||
}
|
}
|
||||||
$intersection = array_intersect_key($val1, $val2);
|
$intersection = array_intersect_key($val1, $val2);
|
||||||
while (list($key,) = each($intersection)) {
|
while (($key = key($intersection)) !== null) {
|
||||||
if ($val1[$key] == $val2[$key]) {
|
if ($val1[$key] == $val2[$key]) {
|
||||||
unset($val1[$key]);
|
unset($val1[$key]);
|
||||||
unset($val2[$key]);
|
unset($val2[$key]);
|
||||||
}
|
}
|
||||||
|
next($intersection);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $val1 + $val2;
|
return $val1 + $val2;
|
||||||
|
|
Loading…
Add table
Reference in a new issue