diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-25 21:08:06 -0400 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-04-19 20:35:13 -0400 |
commit | 7c752aa3defa92128bb1e38ff3305a978d37e4d3 (patch) | |
tree | e92efee3e447279ede4d03253aa6116680c36bc0 /phpBB/includes/functions_user.php | |
parent | 138d2e2a4cbfbac0b6bc04d81b618fac62a69fb9 (diff) | |
download | forums-7c752aa3defa92128bb1e38ff3305a978d37e4d3.tar forums-7c752aa3defa92128bb1e38ff3305a978d37e4d3.tar.gz forums-7c752aa3defa92128bb1e38ff3305a978d37e4d3.tar.bz2 forums-7c752aa3defa92128bb1e38ff3305a978d37e4d3.tar.xz forums-7c752aa3defa92128bb1e38ff3305a978d37e4d3.zip |
[feature/prune-users] Use a map instead of performing array scans.
PHPBB3-9622
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index ff6b60633a..940018ebad 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -614,9 +614,11 @@ function user_delete($mode, $user_ids, $retain_username = true) WHERE ' . $author_id_sql; $db->sql_query($sql); + $user_ids_map = array_flip($user_ids); + foreach ($undelivered_user as $_user_id => $ary) { - if (in_array($_user_id, $user_ids)) + if (isset($user_ids_map[$_user_id])) { continue; } @@ -631,7 +633,7 @@ function user_delete($mode, $user_ids, $retain_username = true) $db->sql_transaction('commit'); // Reset newest user info if appropriate - if (in_array($config['newest_user_id'], $user_ids)) + if (isset($user_ids_map[$config['newest_user_id']])) { update_last_username(); } |