X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55d99c7a77789ff4904bf96eddca3715eb5af9b9..8adb5d455797d5b656ef677c74359e5a578b539f:/src/common/dynarray.cpp diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp index b760aa8b24..2b185f156f 100644 --- a/src/common/dynarray.cpp +++ b/src/common/dynarray.cpp @@ -283,7 +283,10 @@ int name::Index(T lItem, CMPFUNC fnCompare) const \ { \ size_t n = IndexForInsert(lItem, fnCompare); \ \ - return n < m_nCount && m_pItems[n] == lItem ? (int)n : wxNOT_FOUND; \ + return (n >= m_nCount || \ + (*fnCompare)((const void *)(long)lItem, \ + ((const void *)(long)m_pItems[n]))) ? wxNOT_FOUND \ + : (int)n; \ } \ \ /* add item at the end */ \