diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-16 12:09:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-16 12:09:38 +0300 |
commit | a7e5e613f86963c8bf82248ab044e0ea36e42fbc (patch) | |
tree | 39e0e6b3ab4bcb55255302d3d1e989b31247bf7b /plugins/CloudFile/src | |
parent | ecbca42677af470d672e66d3f6950af208f8f212 (diff) |
LIST<>::indexOf(T**) - fast index calculation for direct iterators
Diffstat (limited to 'plugins/CloudFile/src')
-rw-r--r-- | plugins/CloudFile/src/srmm.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/CloudFile/src/srmm.cpp b/plugins/CloudFile/src/srmm.cpp index 68c2cca0cb..8e400bbdbf 100644 --- a/plugins/CloudFile/src/srmm.cpp +++ b/plugins/CloudFile/src/srmm.cpp @@ -54,10 +54,8 @@ int OnSrmmButtonPressed(WPARAM, LPARAM lParam) } HMENU hMenu = CreatePopupMenu(); - for (int i = 0; i < Services.getCount(); i++) { - CCloudService *service = Services[i]; - AppendMenu(hMenu, MF_STRING, i + 1, TranslateW(service->GetUserName())); - } + for (auto &it : Services) + AppendMenu(hMenu, MF_STRING, Services.indexOf(&it) + 1, TranslateW(it->GetUserName())); int pos = TrackPopupMenu(hMenu, TPM_RETURNCMD, cbc->pt.x, cbc->pt.y, 0, cbc->hwndFrom, nullptr); DestroyMenu(hMenu); |