summaryrefslogtreecommitdiff
path: root/plugins/AVS
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-14 19:59:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-14 19:59:06 +0300
commitdad59528ccd770301b29c7db8148ff8ab8e89c92 (patch)
treeb93aa1b9149ddf20d6317d44cf924be8d0be276a /plugins/AVS
parent1a3f9ca88310cb9080a4c0073087bebc4c1e3a0a (diff)
reverse iterators for LIST<>
Diffstat (limited to 'plugins/AVS')
-rw-r--r--plugins/AVS/src/poll.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp
index 1c567c815b..3ba1bf90a0 100644
--- a/plugins/AVS/src/poll.cpp
+++ b/plugins/AVS/src/poll.cpp
@@ -104,11 +104,9 @@ static void QueueRemove(MCONTACT hContact)
{
mir_cslock lck(cs);
- for (int i = queue.getCount() - 1; i >= 0; i--) {
- QueueItem& item = queue[i];
- if (item.hContact == hContact)
- queue.remove(i);
- }
+ for (auto &it : queue.rev_iter())
+ if (it->hContact == hContact)
+ queue.remove(it);
}
// Add an contact to a queue
@@ -120,8 +118,8 @@ void QueueAdd(MCONTACT hContact, int waitTime)
mir_cslock lck(cs);
// Only add if not exists yet
- for (int i = queue.getCount() - 1; i >= 0; i--)
- if (queue[i].hContact == hContact)
+ for (auto &it : queue)
+ if (it->hContact == hContact)
return;
QueueItem *item = new QueueItem;