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/comments.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'admin/comments.php') diff --git a/admin/comments.php b/admin/comments.php index 6d3fcc507..637790353 100644 --- a/admin/comments.php +++ b/admin/comments.php @@ -41,10 +41,7 @@ if (!empty($_POST)) { if (empty($_POST['comments'])) { - array_push( - $page['errors'], - l10n('Select at least one comment') - ); + $page['errors'][] = l10n('Select at least one comment'); } else { @@ -55,12 +52,9 @@ if (!empty($_POST)) { validate_user_comment($_POST['comments']); - array_push( - $page['infos'], - l10n_dec( - '%d user comment validated', '%d user comments validated', - count($_POST['comments']) - ) + $page['infos'][] = l10n_dec( + '%d user comment validated', '%d user comments validated', + count($_POST['comments']) ); } @@ -68,12 +62,9 @@ if (!empty($_POST)) { delete_user_comment($_POST['comments']); - array_push( - $page['infos'], - l10n_dec( - '%d user comment rejected', '%d user comments rejected', - count($_POST['comments']) - ) + $page['infos'][] = l10n_dec( + '%d user comment rejected', '%d user comments rejected', + count($_POST['comments']) ); } } @@ -148,7 +139,7 @@ while ($row = pwg_db_fetch_assoc($result)) ) ); - array_push($list, $row['id']); + $list[] = $row['id']; } $template->assign('LIST', implode(',', $list) ); -- cgit v1.2.3