Change the loop condition to avoid comparing unsigned value with 0.

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
This commit is contained in:
Vadim Zeitlin 2011-06-29 17:50:32 +00:00
parent b02d50281d
commit 99ef43728a

View File

@ -3029,7 +3029,7 @@ wxDataViewTreeNode * wxDataViewMainWindow::FindNode( const wxDataViewItem & item
// 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() )
{
@ -3060,6 +3060,9 @@ wxDataViewTreeNode * wxDataViewMainWindow::FindNode( const wxDataViewItem & item
}
else
return NULL;
if ( !iter )
break;
}
return NULL;
}