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); $keys = array_unique($keys);
foreach ($keys as $k) { foreach ($keys as $k) {
if (!$numeric) { if ($numeric) {
$sorted[] = $data[$k];
} else {
if (isset($originalKeys[$k])) {
$sorted[$originalKeys[$k]] = $data[$originalKeys[$k]]; $sorted[$originalKeys[$k]] = $data[$originalKeys[$k]];
} else { } else {
$sorted[] = $data[$k]; $sorted[$k] = $data[$k];
}
} }
} }
return $sorted; return $sorted;