diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-28 16:34:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-28 16:34:30 +0300 |
commit | 81ce57622c3166830b23eae534dacc6b008c659d (patch) | |
tree | 6d6ac74667f733a20b94fa27cc01c2f45688c533 /protocols/MSN/src/msn_http.cpp | |
parent | c2bb7727483b9b5620e8cc0ce6adae35ee78d0a4 (diff) |
common protocol instance management code went into template
Diffstat (limited to 'protocols/MSN/src/msn_http.cpp')
-rw-r--r-- | protocols/MSN/src/msn_http.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/protocols/MSN/src/msn_http.cpp b/protocols/MSN/src/msn_http.cpp index 6acf97a6d4..5c7fb3079d 100644 --- a/protocols/MSN/src/msn_http.cpp +++ b/protocols/MSN/src/msn_http.cpp @@ -25,11 +25,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. static ThreadData* FindThreadConn(HNETLIBCONN hConn)
{
- ThreadData *res = nullptr;
- for (int i = 0; i < g_Instances.getCount() && res == nullptr; ++i)
- res = g_Instances[i].MSN_GetThreadByConnection(hConn);
+ for (auto &it : CMPlugin::g_arInstances) {
+ ThreadData *res = it->MSN_GetThreadByConnection(hConn);
+ if (res != nullptr)
+ return res;
+ }
- return res;
+ return nullptr;
}
//=======================================================================================
|