diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-09 19:32:32 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-09 19:32:39 +0300 |
commit | df6b0c988eb26339d4c7e4a1d0fe3b9717703c28 (patch) | |
tree | 5b4960edd6c9186e1fbc14f83f7f08a6a842f0a7 /protocols/JabberG/src/jabber_userinfo.cpp | |
parent | 303dd9297732fc943ed3e20ab37587f0c009dfe5 (diff) |
more loop-related code cleaning
Diffstat (limited to 'protocols/JabberG/src/jabber_userinfo.cpp')
-rwxr-xr-x | protocols/JabberG/src/jabber_userinfo.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 610cab6a87..203c1022e2 100755 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -292,15 +292,16 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti sttFillInfoLine(hwndTree, htiCaps, nullptr, nullptr, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i)); } - for (int j = 0; j < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); j++, i++) - if (jcb & ppro->m_lstJabberFeatCapPairsDynamic[j]->jcbCap) { + for (auto &it : ppro->m_lstJabberFeatCapPairsDynamic) { + if (jcb & it->jcbCap) { wchar_t szDescription[1024]; - if (ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription) - mir_snwprintf(szDescription, L"%s (%s)", TranslateW(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature); + if (it->szDescription) + mir_snwprintf(szDescription, L"%s (%s)", TranslateW(it->szDescription), it->szFeature); else - wcsncpy_s(szDescription, ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature, _TRUNCATE); - sttFillInfoLine(hwndTree, htiCaps, nullptr, nullptr, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i)); + wcsncpy_s(szDescription, it->szFeature, _TRUNCATE); + sttFillInfoLine(hwndTree, htiCaps, nullptr, nullptr, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i++)); } + } } // Software info |