From dad59528ccd770301b29c7db8148ff8ab8e89c92 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 14 Mar 2018 19:59:06 +0300 Subject: reverse iterators for LIST<> --- plugins/TabSRMM/src/chat_main.cpp | 3 +-- plugins/TabSRMM/src/eventpopups.cpp | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp index c3fe689df4..0f03ecf541 100644 --- a/plugins/TabSRMM/src/chat_main.cpp +++ b/plugins/TabSRMM/src/chat_main.cpp @@ -174,8 +174,7 @@ static void CheckUpdate() db_enum_settings(0, CopyChatSetting, CHAT_OLDFONTMODULE, &szSettings); DBVARIANT dbv; - for (int i = szSettings.getCount() - 1; i >= 0; i--) { - char *p = szSettings[i]; + for (auto &p : szSettings.rev_iter()) { db_get(0, CHAT_OLDFONTMODULE, p, &dbv); db_set(0, CHATFONT_MODULE, p, &dbv); db_free(&dbv); diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 3f642787b9..4b022070db 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -54,14 +54,13 @@ static PLUGIN_DATAT* PU_GetByContact(const MCONTACT hContact) */ static void PU_CleanUp() { - for (int i = arPopupList.getCount() - 1; i >= 0; i--) { - PLUGIN_DATAT *p = arPopupList[i]; + for (auto &p : arPopupList.rev_iter()) { if (p->hContact != 0) continue; mir_free(p->eventData); mir_free(p); - arPopupList.remove(i); + arPopupList.remove(p); } } -- cgit v1.2.3