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/TopToolBar | |
parent | ecbca42677af470d672e66d3f6950af208f8f212 (diff) |
LIST<>::indexOf(T**) - fast index calculation for direct iterators
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r-- | plugins/TopToolBar/src/toolbar.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index 380daf02dd..a0a77b8536 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -25,11 +25,11 @@ LIST<TopButtonInt> Buttons(8, sortfunc); TopButtonInt *idtopos(int id, int *pPos)
{
- for (int i = 0; i < Buttons.getCount(); i++)
- if (Buttons[i]->id == id) {
+ for (auto &it : Buttons)
+ if (it->id == id) {
if (pPos)
- *pPos = i;
- return Buttons[i];
+ *pPos = Buttons.indexOf(&it);
+ return it;
}
if (pPos)
|