From 4c281b28075dfa69d8cc2301b06492fbddb62f24 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 30 Jan 2020 20:18:37 +0300 Subject: LIST::remove + LIST::indexOf() combination removed with LIST::removeItem --- protocols/Discord/src/dispatch.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'protocols/Discord/src') diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp index 43f569f7a3..10fe201ba1 100644 --- a/protocols/Discord/src/dispatch.cpp +++ b/protocols/Discord/src/dispatch.cpp @@ -120,7 +120,7 @@ void CDiscordProto::OnCommandCallDeleted(const JSONNode &pRoot) for (auto &call : arVoiceCalls.rev_iter()) if (call->channelId == channelId) { elapsed = currTime - call->startTime; - arVoiceCalls.remove(arVoiceCalls.indexOf(&call)); + arVoiceCalls.removeItem(&call); break; } @@ -257,11 +257,10 @@ void CDiscordProto::OnCommandGuildDeleted(const JSONNode &pRoot) if (pGuild == nullptr) return; - auto T = arUsers.rev_iter(); - for (auto &it : T) + for (auto &it : arUsers.rev_iter()) if (it->pGuild == pGuild) { Chat_Terminate(m_szModuleName, it->wszUsername, true); - arUsers.remove(T.indexOf(&it)); + arUsers.removeItem(&it); } Chat_Terminate(m_szModuleName, pRoot["name"].as_mstring(), true); -- cgit v1.2.3