From a7e5e613f86963c8bf82248ab044e0ea36e42fbc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Mar 2018 12:09:30 +0300 Subject: LIST<>::indexOf(T**) - fast index calculation for direct iterators --- protocols/VKontakte/src/misc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/VKontakte') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 551ac57da7..07bf5cd0b5 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -229,9 +229,9 @@ bool CVkProto::IsGroupUser(MCONTACT hContact) bool CVkProto::CheckMid(LIST &lList, int guid) { - for (int i = lList.getCount() - 1; i >= 0; i--) - if ((INT_PTR)lList[i] == guid) { - lList.remove(i); + for (auto &it : lList) + if ((INT_PTR)it == guid) { + lList.remove(lList.indexOf(&it)); return true; } -- cgit v1.2.3