summaryrefslogtreecommitdiff
path: root/plugins/TopToolBar
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-16 12:09:30 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-16 12:09:38 +0300
commita7e5e613f86963c8bf82248ab044e0ea36e42fbc (patch)
tree39e0e6b3ab4bcb55255302d3d1e989b31247bf7b /plugins/TopToolBar
parentecbca42677af470d672e66d3f6950af208f8f212 (diff)
LIST<>::indexOf(T**) - fast index calculation for direct iterators
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r--plugins/TopToolBar/src/toolbar.cpp8
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)