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/cat_list.php | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'admin/cat_list.php') diff --git a/admin/cat_list.php b/admin/cat_list.php index baba5e2c9..6caa393f4 100644 --- a/admin/cat_list.php +++ b/admin/cat_list.php @@ -78,7 +78,7 @@ function save_categories_order($categories) $current_rank++; } - array_push($datas, array('id' => $id, 'rank' => $current_rank)); + $datas[] = array('id' => $id, 'rank' => $current_rank); } $fields = array('primary' => array('id'), 'update' => array('rank')); mass_updates(CATEGORIES_TABLE, $fields, $datas); @@ -133,11 +133,11 @@ else if (isset($_POST['submitAdd'])) if (isset($output_create['error'])) { - array_push($page['errors'], $output_create['error']); + $page['errors'][] = $output_create['error']; } else { - array_push($page['infos'], $output_create['info']); + $page['infos'][] = $output_create['info']; } } // save manual category ordering @@ -146,10 +146,7 @@ else if (isset($_POST['submitManualOrder'])) asort($_POST['catOrd'], SORT_NUMERIC); save_categories_order(array_keys($_POST['catOrd'])); - array_push( - $page['infos'], - l10n('Album manual order was saved') - ); + $page['infos'][] = l10n('Album manual order was saved'); } else if (isset($_POST['submitAutoOrder'])) { @@ -178,17 +175,11 @@ SELECT id, name, id_uppercat $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { - array_push( - $categories, - array( - 'id' => $row['id'], - 'id_uppercat' => $row['id_uppercat'], - ) - ); - array_push( - $names, - $row['name'] + $categories[] = array( + 'id' => $row['id'], + 'id_uppercat' => $row['id_uppercat'], ); + $names[] = $row['name']; } array_multisort( @@ -199,10 +190,7 @@ SELECT id, name, id_uppercat ); save_categories_order($categories); - array_push( - $page['infos'], - l10n('Albums automatically sorted') - ); + $page['infos'][] = l10n('Albums automatically sorted'); } // +-----------------------------------------------------------------------+ -- cgit v1.2.3