diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-30 20:18:37 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-30 20:18:46 +0300 |
commit | 4c281b28075dfa69d8cc2301b06492fbddb62f24 (patch) | |
tree | b788f37caaff5063fd36eecad191d2a5582be12c /protocols/JabberG | |
parent | a243c59835182e2a1fa91d9c7bd80defea88e4e8 (diff) |
LIST::remove + LIST::indexOf() combination removed with LIST::removeItem
Diffstat (limited to 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber_frame.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_list.cpp | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index 2bd6ffd688..6d5a1a6a83 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -471,13 +471,13 @@ void CJabberInfoFrame::RemoveInfoItem(char *pszName) {
bool bUpdate = false;
size_t length = mir_strlen(pszName);
- auto T = m_pItems.rev_iter();
- for (auto &p : T) {
+
+ for (auto &p : m_pItems.rev_iter()) {
if (!strncmp(p->m_pszName, pszName, length)) {
if (!p->m_bShow)
--m_hiddenItemCount;
RemoveTooltip(p->m_tooltipId);
- m_pItems.remove(T.indexOf(&p));
+ m_pItems.removeItem(&p);
bUpdate = true;
}
}
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp index fc1dfc5294..0b05136806 100644 --- a/protocols/JabberG/src/jabber_list.cpp +++ b/protocols/JabberG/src/jabber_list.cpp @@ -176,12 +176,9 @@ void CJabberProto::ListRemove(JABBER_LIST list, const char *jid) void CJabberProto::ListRemoveList(JABBER_LIST list)
{
mir_cslock lck(m_csLists);
- for (auto &it : m_lstRoster.rev_iter()) {
- if (it->list == list) {
- delete it;
- m_lstRoster.remove(m_lstRoster.indexOf(&it));
- }
- }
+ for (auto &it : m_lstRoster.rev_iter())
+ if (it->list == list)
+ delete m_lstRoster.removeItem(&it);
}
void CJabberProto::ListRemoveByIndex(int index)
|