From e8830f605f73a0c8fa5c3ea579ee18f295b81600 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:18:02 +0200 Subject: [PATCH] [ticket/10605] Use unset() instead of checking user_id over and over again. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 34f16ea9da..59dea50094 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1134,13 +1134,9 @@ function phpbb_delete_user_pms($user_id) $db->sql_query($sql); } + unset($undelivered_user[$user_id]); foreach ($undelivered_user as $_user_id => $ary) { - if ($_user_id == $user_id) - { - continue; - } - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ', user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . '