mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-03 23:52:24 +01:00
Perf: Little speed enhancement
This commit is contained in:
@@ -3915,7 +3915,8 @@ function dol_sort_array(&$array, $index, $order='asc', $natsort, $case_sensitive
|
||||
// Clean parameters
|
||||
$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];
|
||||
if (!$natsort) ($order=='asc') ? asort($temp) : arsort($temp);
|
||||
|
||||
Reference in New Issue
Block a user