From 1af62415a03e312a813a4f56ba9606d3ed9ab1ee Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 21 Feb 2023 20:26:50 +0300 Subject: these iterator variables became useless --- plugins/Clist_modern/src/modern_aniavatars.cpp | 3 +-- plugins/Variables/src/contact.cpp | 2 +- src/core/stduserinfo/src/userinfo.cpp | 6 ++---- src/mir_app/src/chat_manager.cpp | 3 +-- src/mir_app/src/proto_accs.cpp | 3 +-- src/mir_app/src/sounds.cpp | 3 +-- src/mir_app/src/srmm_toolbar.cpp | 3 +-- src/mir_core/src/Windows/threads.cpp | 3 +-- 8 files changed, 9 insertions(+), 17 deletions(-) diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index babff44fa8..90a4cf038e 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -265,8 +265,7 @@ static void _AniAva_ResumePainting() static void _AniAva_ReduceAvatarImages(int startY, int dY, BOOL bDestroyWindow) { - auto T = s_Objects.rev_iter(); - for (auto &it : T) { + for (auto &it : s_Objects.rev_iter()) { int res = SendMessage(it->hWindow, AAM_REMOVEAVATAR, (WPARAM)startY, (LPARAM)dY); if (res == 0xDEAD && bDestroyWindow) s_Objects.removeItem(&it); diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 5904a2cd23..2d5e1fca0d 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -76,7 +76,7 @@ static builtinCnfs[] = /* contact cache entry */ struct CONTACTCE { - uint32_t flags; + uint32_t flags; wchar_t* tszContact; MCONTACT hContact; }; diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 96d15c8805..a8757ab008 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -119,10 +119,8 @@ class CUserInfoDlg : public CDlgBase for (auto &it : items.rev_iter()) { it->pDialog->SetContact(hContact); - if (!it->pDialog->IsEmpty()) - continue; - - delete items.removeItem(&it); + if (it->pDialog->IsEmpty()) + delete items.removeItem(&it); } if (items.getCount() == 0) diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index ed674c556a..74b3fa2a64 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -206,8 +206,7 @@ int SM_RemoveModule(const char *pszModule, bool removeContact) if (pszModule == nullptr) return FALSE; - auto T = g_arSessions.rev_iter(); - for (auto &si : T) + for (auto &si : g_arSessions.rev_iter()) if (si->iType != GCW_SERVER && !mir_strcmpi(si->pszModule, pszModule)) SM_FreeSession(g_arSessions.removeItem(&si), removeContact); diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index 690c58bb76..d8d532f9e4 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -415,8 +415,7 @@ void UnloadAccountsModule() if (!bModuleInitialized) return; - auto T = g_arAccounts.rev_iter(); - for (auto &it : T) { + for (auto &it : g_arAccounts.rev_iter()) { UnloadAccount(it, 0); g_arAccounts.removeItem(&it); } diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index 8762adb26b..959289a3a1 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -367,8 +367,7 @@ void KillModuleSounds(CMPluginBase *pPlugin) { bool bFound = false; - auto T = arSounds.rev_iter(); - for (auto &it : T) + for (auto &it : arSounds.rev_iter()) if (it->pPlugin == pPlugin) { arSounds.removeItem(&it); bFound = true; diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp index fb593ea1a4..45450eaa26 100644 --- a/src/mir_app/src/srmm_toolbar.cpp +++ b/src/mir_app/src/srmm_toolbar.cpp @@ -819,8 +819,7 @@ void KillModuleToolbarIcons(CMPluginBase *pPlugin) { int oldCount = arButtonsList.getCount(); - auto T = arButtonsList.rev_iter(); - for (auto &cbd : T) + for (auto &cbd : arButtonsList.rev_iter()) if (cbd->m_pPlugin == pPlugin) delete arButtonsList.removeItem(&cbd); diff --git a/src/mir_core/src/Windows/threads.cpp b/src/mir_core/src/Windows/threads.cpp index c33a80faed..b48a9c7b79 100644 --- a/src/mir_core/src/Windows/threads.cpp +++ b/src/mir_core/src/Windows/threads.cpp @@ -230,8 +230,7 @@ static void __cdecl KillObjectThreadsWorker(void* owner) // forcibly kill all remaining threads after 5 secs mir_cslock lck(csThreads); - auto T = threads.rev_iter(); - for (auto &it : T) { + for (auto &it : threads.rev_iter()) { if (it->pObject == owner) { char szModuleName[MAX_PATH]; GetModuleFileNameA(it->hOwner, szModuleName, sizeof(szModuleName)); -- cgit v1.2.3