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 /include | |
parent | ecbca42677af470d672e66d3f6950af208f8f212 (diff) |
LIST<>::indexOf(T**) - fast index calculation for direct iterators
Diffstat (limited to 'include')
-rw-r--r-- | include/m_system_cpp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h index b262254dfb..b0f15305de 100644 --- a/include/m_system_cpp.h +++ b/include/m_system_cpp.h @@ -233,6 +233,7 @@ template<class T> struct LIST __inline int insert(T *p) { return List_InsertPtr((SortedList*)this, p); }
__inline int remove(T *p) { return List_RemovePtr((SortedList*)this, p); }
+ __inline int indexOf(T **p) const { return int(p - items); }
__inline T* removeItem(T **p)
{
T *savePtr = *p;
|