summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-09 19:32:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-09 19:32:39 +0300
commitdf6b0c988eb26339d4c7e4a1d0fe3b9717703c28 (patch)
tree5b4960edd6c9186e1fbc14f83f7f08a6a842f0a7 /src/core
parent303dd9297732fc943ed3e20ab37587f0c009dfe5 (diff)
more loop-related code cleaning
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdmsg/src/cmdlist.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp
index 32e6049de4..3b44e921c9 100644
--- a/src/core/stdmsg/src/cmdlist.cpp
+++ b/src/core/stdmsg/src/cmdlist.cpp
@@ -65,17 +65,16 @@ TMsgQueue* msgQueue_find(MCONTACT hContact, int id)
MCONTACT hMeta = db_mc_getMeta(hContact);
mir_cslockfull lck(csMsgQueue);
- for (int i = 0; i < msgQueue.getCount(); i++) {
- TMsgQueue *item = msgQueue[i];
- if ((item->hContact == hContact || item->hContact == hMeta) && item->id == id) {
- msgQueue.remove(i);
+ for (auto &it : msgQueue) {
+ if ((it->hContact == hContact || it->hContact == hMeta) && it->id == id) {
+ msgQueue.remove(it);
if (!msgQueue.getCount() && timerId) {
KillTimer(nullptr, timerId);
timerId = 0;
}
- return item;
+ return it;
}
}
return nullptr;