From a7e5e613f86963c8bf82248ab044e0ea36e42fbc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Mar 2018 12:09:30 +0300 Subject: LIST<>::indexOf(T**) - fast index calculation for direct iterators --- include/m_system_cpp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') 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 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; -- cgit v1.2.3