diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-20 10:51:35 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-20 10:51:35 +0000 |
commit | 2fe00cdd66d4559cc43a5f27c19ddc79a43676eb (patch) | |
tree | 546def30affbabeaad425c9a25e2545e1e4096f5 /protocols/JabberG/src/jabber_groupchat.cpp | |
parent | f946ebcb1ac09b7220f8547074496aa2d1b83768 (diff) |
- all manual list locks removed;
- ListExists removed and replaced with ListGetItemPtr;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@5426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_groupchat.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_groupchat.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 25f0d1bb93..858535b3ab 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -202,19 +202,13 @@ private: JABBER_RESOURCE_STATUS* CJabberProto::GcFindResource(JABBER_LIST_ITEM *item, const TCHAR *resource)
{
- JABBER_RESOURCE_STATUS *res = NULL;
-
- EnterCriticalSection(&m_csLists);
+ mir_cslock lck(m_csLists);
JABBER_RESOURCE_STATUS *r = item->pResources;
- for (int i=0; i<item->resourceCount; i++) {
- if ( !_tcscmp(r[i].resourceName, resource)) {
- res = &r[i];
- break;
- }
- }
- LeaveCriticalSection(&m_csLists);
+ for (int i=0; i < item->resourceCount; i++)
+ if ( !_tcscmp(r[i].resourceName, resource))
+ return &r[i];
- return res;
+ return NULL;
}
INT_PTR __cdecl CJabberProto::OnMenuHandleJoinGroupchat(WPARAM, LPARAM)
|