Extra optimization for Set::diff(). Refer commit fde10b1.

This commit is contained in:
Juan Basso 2010-01-31 21:23:32 -02:00 committed by José Lorenzo Rodríguez
parent 59a4732eb8
commit a89d9e4830

View file

@ -790,11 +790,12 @@ class Set {
return (array)$val1;
}
$intersection = array_intersect_key($val1, $val2);
while (list($key,) = each($intersection)) {
while (($key = key($intersection)) !== null) {
if ($val1[$key] == $val2[$key]) {
unset($val1[$key]);
unset($val2[$key]);
}
next($intersection);
}
return $val1 + $val2;