summaryrefslogtreecommitdiff
path: root/protocols/Twitter
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-26 22:31:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-26 22:31:27 +0300
commit391980ce1e890445542441eeb5d9f9cc18ae1baf (patch)
treeee1b165175dcdaeeaabd2ddb822542e648663a90 /protocols/Twitter
parentbf8ad124d03b4fd059318d9ba8889b11faaf5b53 (diff)
code optimization
Diffstat (limited to 'protocols/Twitter')
-rw-r--r--protocols/Twitter/src/theme.cpp10
-rw-r--r--protocols/Twitter/src/ui.cpp8
2 files changed, 9 insertions, 9 deletions
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp
index 2e22f7398e..c7e7c69f55 100644
--- a/protocols/Twitter/src/theme.cpp
+++ b/protocols/Twitter/src/theme.cpp
@@ -46,9 +46,9 @@ void InitIcons(void)
HANDLE GetIconHandle(const char *name)
{
- for (size_t i = 0; i < _countof(icons); i++)
- if (mir_strcmp(icons[i].szName, name) == 0)
- return icons[i].hIcolib;
+ for (auto &it : icons)
+ if (mir_strcmp(it.szName, name) == 0)
+ return it.hIcolib;
return nullptr;
}
@@ -111,6 +111,6 @@ void InitContactMenus()
void ShowContactMenus(bool show)
{
- for (size_t i = 0; i < _countof(g_hMenuItems); i++)
- Menu_ShowItem(g_hMenuItems[i], show);
+ for (auto &it : g_hMenuItems)
+ Menu_ShowItem(it, show);
}
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp
index a94395829a..d7164be99e 100644
--- a/protocols/Twitter/src/ui.cpp
+++ b/protocols/Twitter/src/ui.cpp
@@ -50,8 +50,8 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
db_free(&dbv);
}
- for (size_t i = 0; i < _countof(sites); i++)
- SendDlgItemMessage(hwndDlg, IDC_SERVER, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(sites[i]));
+ for (auto &it : sites)
+ SendDlgItemMessage(hwndDlg, IDC_SERVER, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(it));
if (!proto->getString(TWITTER_KEY_BASEURL, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_SERVER, dbv.pszVal);
@@ -180,8 +180,8 @@ INT_PTR CALLBACK options_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
CheckDlgButton(hwndDlg, IDC_CHATFEED, proto->getByte(TWITTER_KEY_CHATFEED) ? BST_CHECKED : BST_UNCHECKED);
- for (size_t i = 0; i < _countof(sites); i++)
- SendDlgItemMessage(hwndDlg, IDC_BASEURL, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(sites[i]));
+ for (auto &it : sites)
+ SendDlgItemMessage(hwndDlg, IDC_BASEURL, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(it));
if (!proto->getString(TWITTER_KEY_BASEURL, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_BASEURL, dbv.pszVal);