From ae707279a1945e383c312cd648d288606a79e341 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sat, 19 Oct 2013 17:43:04 +0000 Subject: remove all array_push (50% slower than []) + some changes missing for feature:2978 git-svn-id: http://piwigo.org/svn/trunk@25018 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/stats.php | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) (limited to 'admin/stats.php') diff --git a/admin/stats.php b/admin/stats.php index d6fd0235a..658d158c2 100644 --- a/admin/stats.php +++ b/admin/stats.php @@ -97,7 +97,7 @@ SELECT $output = array(); while ($row = pwg_db_fetch_assoc($result)) { - array_push($output, $row); + $output[] = $row; } return $output; @@ -226,7 +226,7 @@ SELECT * if (isset($need_update[$key])) { $row['nb_pages'] += $need_update[$key]; - array_push($updates, $row); + $updates[] = $row; unset($need_update[$key]); } } @@ -236,16 +236,13 @@ foreach ($need_update as $time_key => $nb_pages) { $time_tokens = explode('-', $time_key); - array_push( - $inserts, - array( - 'year' => $time_tokens[0], - 'month' => @$time_tokens[1], - 'day' => @$time_tokens[2], - 'hour' => @$time_tokens[3], - 'nb_pages' => $nb_pages, - ) - ); + $inserts[] = array( + 'year' => $time_tokens[0], + 'month' => @$time_tokens[1], + 'day' => @$time_tokens[2], + 'hour' => @$time_tokens[3], + 'nb_pages' => $nb_pages, + ); } if (count($updates) > 0) @@ -323,10 +320,7 @@ $title_parts = array(); $url = PHPWG_ROOT_PATH.'admin.php?page=stats'; -array_push( - $title_parts, - ''.l10n('Overall').'' - ); +$title_parts[] = ''.l10n('Overall').''; $period_label = l10n('Year'); @@ -334,10 +328,7 @@ if (isset($page['year'])) { $url.= '&year='.$page['year']; - array_push( - $title_parts, - ''.$page['year'].'' - ); + $title_parts[] = ''.$page['year'].''; $period_label = l10n('Month'); } @@ -346,10 +337,7 @@ if (isset($page['month'])) { $url.= '&month='.$page['month']; - array_push( - $title_parts, - ''.$lang['month'][$page['month']].'' - ); + $title_parts[] = ''.$lang['month'][$page['month']].''; $period_label = l10n('Day'); } @@ -366,10 +354,7 @@ if (isset($page['day'])) $lang['day'][date('w', $time)] ); - array_push( - $title_parts, - ''.$day_title.'' - ); + $title_parts[] = ''.$day_title.''; $period_label = l10n('Hour'); } -- cgit v1.2.3