This resulted in (useful) g++ warning and didn't make any sense in any case.
Check for the loop variable value being 0 at the end of the loop instead now.
If the old code was correct it shouldn't change its behaviour and if not, this
might fix a bug.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68100
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Find the item along the parent-chain.
// This algorithm is designed to speed up the node-finding method
wxDataViewTreeNode* node = m_root;
- for( unsigned iter = parentChain.size()-1; iter>=0; --iter )
+ for( unsigned iter = parentChain.size()-1; ; --iter )
{
if( node->HasChildren() )
{
}
else
return NULL;
+
+ if ( !iter )
+ break;
}
return NULL;
}