Use pre-increment operator to increment iterator in the loop (propgrid sample).
When the return value is ignored, the ++it is never less efficient than the it++.
This commit is contained in:
@@ -1162,7 +1162,7 @@ void FormMain::PopulateWithStandardItems ()
|
||||
|
||||
for ( it = pg->GetGrid()->GetIterator();
|
||||
!it.AtEnd();
|
||||
it++ )
|
||||
++it )
|
||||
{
|
||||
wxPGProperty* p = *it;
|
||||
if ( p->IsCategory() )
|
||||
@@ -2370,7 +2370,7 @@ void FormMain::OnIterate1Click( wxCommandEvent& WXUNUSED(event) )
|
||||
for ( it = m_pPropGridManager->GetCurrentPage()->
|
||||
GetIterator();
|
||||
!it.AtEnd();
|
||||
it++ )
|
||||
++it )
|
||||
{
|
||||
wxPGProperty* p = *it;
|
||||
int res = IterateMessage( p );
|
||||
@@ -2387,7 +2387,7 @@ void FormMain::OnIterate2Click( wxCommandEvent& WXUNUSED(event) )
|
||||
for ( it = m_pPropGridManager->GetCurrentPage()->
|
||||
GetIterator( wxPG_ITERATE_VISIBLE );
|
||||
!it.AtEnd();
|
||||
it++ )
|
||||
++it )
|
||||
{
|
||||
wxPGProperty* p = *it;
|
||||
|
||||
@@ -2424,7 +2424,7 @@ void FormMain::OnIterate4Click( wxCommandEvent& WXUNUSED(event) )
|
||||
for ( it = m_pPropGridManager->GetCurrentPage()->
|
||||
GetIterator( wxPG_ITERATE_CATEGORIES );
|
||||
!it.AtEnd();
|
||||
it++ )
|
||||
++it )
|
||||
{
|
||||
wxPGProperty* p = *it;
|
||||
|
||||
|
@@ -296,7 +296,7 @@ wxArrayPGProperty GetPropertiesInRandomOrder( wxPropertyGridInterface* props, in
|
||||
|
||||
for ( it = props->GetIterator(iterationFlags);
|
||||
!it.AtEnd();
|
||||
it++ )
|
||||
++it )
|
||||
{
|
||||
wxPGProperty* p = *it;
|
||||
size_t randomNumber = rand();
|
||||
@@ -440,7 +440,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
|
||||
for ( it = page->GetIterator(wxPG_ITERATE_VISIBLE);
|
||||
!it.AtEnd();
|
||||
it++ )
|
||||
++it )
|
||||
{
|
||||
wxPGProperty* p = *it;
|
||||
RT_MSG(p->GetLabel());
|
||||
@@ -962,7 +962,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
|
||||
for ( it = page->GetIterator( wxPG_ITERATE_CATEGORIES );
|
||||
!it.AtEnd();
|
||||
it++ )
|
||||
++it )
|
||||
{
|
||||
wxPGProperty* p = *it;
|
||||
|
||||
@@ -1003,7 +1003,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
|
||||
for ( it = page->GetIterator( wxPG_ITERATE_CATEGORIES );
|
||||
!it.AtEnd();
|
||||
it++ )
|
||||
++it )
|
||||
{
|
||||
wxPGProperty* p = *it;
|
||||
|
||||
@@ -1053,7 +1053,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
|
||||
for ( it = page->GetIterator( wxPG_ITERATE_CATEGORIES );
|
||||
!it.AtEnd();
|
||||
it++ )
|
||||
++it )
|
||||
{
|
||||
arr.Add((void*)*it);
|
||||
}
|
||||
|
Reference in New Issue
Block a user