From 391980ce1e890445542441eeb5d9f9cc18ae1baf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 26 Jan 2018 22:31:20 +0300 Subject: code optimization --- plugins/Clist_nicer/src/extBackg.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'plugins/Clist_nicer/src/extBackg.cpp') diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index a5ee0a0fe6..182f17b269 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -271,10 +271,9 @@ StatusItems_t *GetProtocolStatusItem(const char *szProto) // fills the struct with the settings in the database void LoadExtBkSettingsFromDB() { - int i, n; - for (i = 0; i < _countof(_StatusItems); i++) { + for (auto &it : _StatusItems) { StatusItems_t *p = (StatusItems_t*)mir_alloc(sizeof(StatusItems_t)); - *p = _StatusItems[i]; + *p = it; arStatusItems.insert(p); } @@ -282,7 +281,7 @@ void LoadExtBkSettingsFromDB() PROTOACCOUNT **accs; Proto_EnumAccounts(&protoCount, &accs); - for (i = 0; i < protoCount; i++) { + for (int i = 0; i < protoCount; i++) { StatusItems_t *p = (StatusItems_t*)mir_alloc(sizeof(StatusItems_t)); *p = _StatusItems[0]; ID_EXTBK_LAST++; @@ -296,7 +295,7 @@ void LoadExtBkSettingsFromDB() arStatusItems.insert(p); } - for (n = 0; n < arStatusItems.getCount(); n++) { + for (int n = 0; n < arStatusItems.getCount(); n++) { StatusItems_t *p = arStatusItems[n]; if (p->statusID == ID_EXTBKSEPARATOR) continue; -- cgit v1.2.3