diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-26 22:31:20 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-26 22:31:27 +0300 |
commit | 391980ce1e890445542441eeb5d9f9cc18ae1baf (patch) | |
tree | ee1b165175dcdaeeaabd2ddb822542e648663a90 /plugins/Clist_nicer/src/extBackg.cpp | |
parent | bf8ad124d03b4fd059318d9ba8889b11faaf5b53 (diff) |
code optimization
Diffstat (limited to 'plugins/Clist_nicer/src/extBackg.cpp')
-rw-r--r-- | plugins/Clist_nicer/src/extBackg.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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;
|