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/VKontakte/src | |
parent | 303dd9297732fc943ed3e20ab37587f0c009dfe5 (diff) |
more loop-related code cleaning
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index c8479c6911..551ac57da7 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -519,14 +519,15 @@ void CVkProto::GrabCookies(NETLIBHTTPREQUEST *nhr) }
if (!szCookieName.IsEmpty() && !szDomain.IsEmpty()) {
- int k;
- for (k = 0; k < m_cookies.getCount(); k++) {
- if (m_cookies[k].m_name == szCookieName) {
- m_cookies[k].m_value = szCookieVal;
+ bool bFound = false;
+ for (auto &it : m_cookies)
+ if (it->m_name == szCookieName) {
+ bFound = true;
+ it->m_value = szCookieVal;
break;
}
- }
- if (k == m_cookies.getCount())
+
+ if (!bFound)
m_cookies.insert(new CVkCookie(szCookieName, szCookieVal, szDomain));
}
}
|