X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/79e929e79ebbd2e1c4ff7f35d619c0b8b30f0135..4b26b60fac70f89cf33935f78469e27536d8b614:/src/common/dynarray.cpp?ds=sidebyside diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp index c6890ce3a0..2b185f156f 100644 --- a/src/common/dynarray.cpp +++ b/src/common/dynarray.cpp @@ -6,7 +6,7 @@ // Created: 12.09.97 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -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 */ \