From: Vadim Zeitlin Date: Tue, 21 Mar 2006 13:00:19 +0000 (+0000) Subject: reuse operator bool() check in compatibility_iterator::IndexOf() instead of rewriting it X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0b6cf205888513d5bffb2cd0c13fcde5cf313168?ds=inline reuse operator bool() check in compatibility_iterator::IndexOf() instead of rewriting it git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38240 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/list.h b/include/wx/list.h index bb80b07f44..8499b8a94f 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -191,11 +191,8 @@ private: } \ int IndexOf() const \ { \ - return m_list ? \ - m_iter != m_list->end() ? \ - std::distance( m_list->begin(), m_iter ) : \ - wxNOT_FOUND : \ - wxNOT_FOUND; \ + return *this ? std::distance( m_list->begin(), m_iter ) \ + : wxNOT_FOUND; \ } \ }; \ public: \