*really* fixed searching in sorted arrays

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-04-27 15:17:46 +00:00
parent 13a6fb3a25
commit bb793b0cfb

View File

@@ -283,10 +283,10 @@ int name::Index(T lItem, CMPFUNC fnCompare) const \
{ \ { \
size_t n = IndexForInsert(lItem, fnCompare); \ size_t n = IndexForInsert(lItem, fnCompare); \
\ \
return n < m_nCount && \ return (n >= m_nCount || \
(*fnCompare)((const void *)(long)lItem, \ (*fnCompare)((const void *)(long)lItem, \
((const void *)(long)m_pItems[n])) ? wxNOT_FOUND \ ((const void *)(long)m_pItems[n]))) ? wxNOT_FOUND \
: (int)n; \ : (int)n; \
} \ } \
\ \
/* add item at the end */ \ /* add item at the end */ \