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