mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/prune-users] Use a map instead of performing array scans.
PHPBB3-9622
This commit is contained in:
parent
138d2e2a4c
commit
7c752aa3de
1 changed files with 4 additions and 2 deletions
|
@ -614,9 +614,11 @@ function user_delete($mode, $user_ids, $retain_username = true)
|
||||||
WHERE ' . $author_id_sql;
|
WHERE ' . $author_id_sql;
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
$user_ids_map = array_flip($user_ids);
|
||||||
|
|
||||||
foreach ($undelivered_user as $_user_id => $ary)
|
foreach ($undelivered_user as $_user_id => $ary)
|
||||||
{
|
{
|
||||||
if (in_array($_user_id, $user_ids))
|
if (isset($user_ids_map[$_user_id]))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -631,7 +633,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
|
||||||
$db->sql_transaction('commit');
|
$db->sql_transaction('commit');
|
||||||
|
|
||||||
// Reset newest user info if appropriate
|
// 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();
|
update_last_username();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue