summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-15 15:33:54 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-15 15:34:09 +0300
commit44b60862c97e5ec855d2bacd4d15f81f7ae7f410 (patch)
treecfe6fd232fac8c80c2f7673804352b94187d698b /protocols/IcqOscarJ
parent0a03c7c9ccd36ce03bdb9feb4827314e4dd553c6 (diff)
MUCH more effective way of removing records from iterators
Diffstat (limited to 'protocols/IcqOscarJ')
-rw-r--r--protocols/IcqOscarJ/src/cookies.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/IcqOscarJ/src/cookies.cpp b/protocols/IcqOscarJ/src/cookies.cpp
index de73d58e03..a517f93923 100644
--- a/protocols/IcqOscarJ/src/cookies.cpp
+++ b/protocols/IcqOscarJ/src/cookies.cpp
@@ -33,9 +33,10 @@ void CIcqProto::RemoveExpiredCookies()
{
time_t tNow = time(nullptr);
- for (auto &it : cookies.rev_iter())
+ auto T = cookies.rev_iter();
+ for (auto &it : T)
if (it->dwTime + COOKIE_TIMEOUT < tNow)
- cookies.remove(it);
+ cookies.remove(T.indexOf(&it));
}
// Generate and allocate cookie