diff options
author | mistic100 <mistic@piwigo.org> | 2013-10-19 17:43:04 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2013-10-19 17:43:04 +0000 |
commit | ae707279a1945e383c312cd648d288606a79e341 (patch) | |
tree | 917bdc6e0609ed0eefed5f3693de3a017685acc4 /admin/cat_perm.php | |
parent | 35ff1b7c1f933799397a0ce0a6723cf82f416ff3 (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | admin/cat_perm.php | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/admin/cat_perm.php b/admin/cat_perm.php index b7b32ac2e..1c3904016 100644 --- a/admin/cat_perm.php +++ b/admin/cat_perm.php @@ -125,7 +125,7 @@ SELECT $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { - array_push($granteds[$row['cat_id']], $row['group_id']); + $granteds[ $row['cat_id'] ][] = $row['group_id']; } $inserts = array(); @@ -135,12 +135,9 @@ SELECT $group_ids = array_diff($grant_groups, $granteds[$cat_id]); foreach ($group_ids as $group_id) { - array_push( - $inserts, - array( - 'group_id' => $group_id, - 'cat_id' => $cat_id - ) + $inserts[] = array( + 'group_id' => $group_id, + 'cat_id' => $cat_id ); } } @@ -190,7 +187,7 @@ DELETE } } - array_push($page['infos'], l10n('Album updated successfully')); + $page['infos'][] = l10n('Album updated successfully'); } // +-----------------------------------------------------------------------+ @@ -272,11 +269,11 @@ SELECT user_id, group_id $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { - if (!isset($granted_groups[$row['group_id']])) + if (!isset($granted_groups[ $row['group_id'] ])) { - $granted_groups[$row['group_id']] = array(); + $granted_groups[ $row['group_id'] ] = array(); } - array_push($granted_groups[$row['group_id']], $row['user_id']); + $granted_groups[ $row['group_id'] ][] = $row['user_id']; } $user_granted_by_group_ids = array(); @@ -302,7 +299,7 @@ SELECT user_id, group_id { if (in_array($user_id, $user_granted_indirect_ids)) { - array_push($group_usernames, $users[$user_id]); + $group_usernames[] = $users[$user_id]; } } |