diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-14 19:59:06 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-14 19:59:06 +0300 |
commit | dad59528ccd770301b29c7db8148ff8ab8e89c92 (patch) | |
tree | b93aa1b9149ddf20d6317d44cf924be8d0be276a /src/core | |
parent | 1a3f9ca88310cb9080a4c0073087bebc4c1e3a0a (diff) |
reverse iterators for LIST<>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdmsg/src/cmdlist.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index 3b44e921c9..23c6fbe20b 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -32,13 +32,11 @@ static VOID CALLBACK MsgTimer(HWND, UINT, UINT_PTR, DWORD dwTime) LIST<TMsgQueue> arTimedOut(1);
{
mir_cslock lck(csMsgQueue);
- for (int i = msgQueue.getCount() - 1; i >= 0; i--) {
- TMsgQueue *item = msgQueue[i];
- if (dwTime - item->ts > g_dat.msgTimeout) {
- arTimedOut.insert(item);
- msgQueue.remove(i);
+ for (auto &it : msgQueue.rev_iter())
+ if (dwTime - it->ts > g_dat.msgTimeout) {
+ arTimedOut.insert(it);
+ msgQueue.remove(it);
}
- }
}
for (auto &it : arTimedOut)
|