From 44b60862c97e5ec855d2bacd4d15f81f7ae7f410 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Mar 2018 15:33:54 +0300 Subject: MUCH more effective way of removing records from iterators --- plugins/AVS/src/poll.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/AVS/src') diff --git a/plugins/AVS/src/poll.cpp b/plugins/AVS/src/poll.cpp index 3ba1bf90a0..940d44f184 100644 --- a/plugins/AVS/src/poll.cpp +++ b/plugins/AVS/src/poll.cpp @@ -104,9 +104,10 @@ static void QueueRemove(MCONTACT hContact) { mir_cslock lck(cs); - for (auto &it : queue.rev_iter()) + auto T = queue.rev_iter(); + for (auto &it : T) if (it->hContact == hContact) - queue.remove(it); + queue.remove(T.indexOf(&it)); } // Add an contact to a queue -- cgit v1.2.3