fix Set::sort() for issue in previous commit

This commit is contained in:
Rachman Chavik 2012-03-13 12:45:06 +07:00
parent beb0474d67
commit af575027da

View file

@ -1089,10 +1089,14 @@ class Set {
$keys = array_unique($keys);
foreach ($keys as $k) {
if (!$numeric) {
$sorted[$originalKeys[$k]] = $data[$originalKeys[$k]];
} else {
if ($numeric) {
$sorted[] = $data[$k];
} else {
if (isset($originalKeys[$k])) {
$sorted[$originalKeys[$k]] = $data[$originalKeys[$k]];
} else {
$sorted[$k] = $data[$k];
}
}
}
return $sorted;