Perf: Little speed enhancement
This commit is contained in:
parent
9a7e46203e
commit
9c78691199
@ -3915,7 +3915,8 @@ function dol_sort_array(&$array, $index, $order='asc', $natsort, $case_sensitive
|
|||||||
// Clean parameters
|
// Clean parameters
|
||||||
$order=strtolower($order);
|
$order=strtolower($order);
|
||||||
|
|
||||||
if (is_array($array) && count($array)>0)
|
$sizearray=count($array);
|
||||||
|
if (is_array($array) && $sizearray>0)
|
||||||
{
|
{
|
||||||
foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index];
|
foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index];
|
||||||
if (!$natsort) ($order=='asc') ? asort($temp) : arsort($temp);
|
if (!$natsort) ($order=='asc') ? asort($temp) : arsort($temp);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user