diff options
Diffstat (limited to 'protocols/JabberG/src/jabber_list.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_list.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp index 0d102bf196..8a4b817965 100644 --- a/protocols/JabberG/src/jabber_list.cpp +++ b/protocols/JabberG/src/jabber_list.cpp @@ -362,13 +362,11 @@ pResourceStatus JABBER_LIST_ITEM::getBestResource() const return m_pManualResource;
int nBestPos = -1, nBestPri = -200;
- for (int i = 0; i < arResources.getCount(); i++) {
- JABBER_RESOURCE_STATUS *r = arResources[i];
+ for (auto &r : arResources)
if (r->m_iPriority > nBestPri) {
nBestPri = r->m_iPriority;
- nBestPos = i;
+ nBestPos = arResources.indexOf(&r);
}
- }
return (nBestPos != -1) ? arResources[nBestPos] : nullptr;
}
|