diff --git a/headers/private/shared/ObjectList.h b/headers/private/shared/ObjectList.h index 6fc9f16cf3..04a59bf1a3 100644 --- a/headers/private/shared/ObjectList.h +++ b/headers/private/shared/ObjectList.h @@ -203,6 +203,10 @@ public: T *BinarySearchByKey(const Key &key, int (*compare)(const Key *, const T *, void *), void *state) const; + int32 BinarySearchIndex(const T &item, CompareFunction compare) const; + int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare, + void *state) const; + // Binary insertion - list must be sorted with CompareFunction for // these to work @@ -670,6 +674,25 @@ BObjectList::BinarySearchByKey(const Key &key, } +template +int32 +BObjectList::BinarySearchIndex(const T &item, CompareFunction compare) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunction)compare); +} + + +template +int32 +BObjectList::BinarySearchIndex(const T &item, + CompareFunctionWithState compare, void *state) const +{ + return _PointerList_::BinarySearchIndex(&item, + (GenericCompareFunctionWithState)compare, state); +} + + template bool BObjectList::BinaryInsert(T *item, CompareFunction func)