From 4228e3210fb31faa9917aea24451e64075146dc9 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 26 Jun 2015 18:15:45 +0200 Subject: [PATCH] Use pre-increment/decrement operators to move iterator in the loop (propgrid sample). When the return value is ignored, the ++it/--it is never less efficient than the it++/it--. --- samples/propgrid/propgrid.cpp | 2 +- samples/propgrid/tests.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index c76a07df30..857f2dcb81 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -2406,7 +2406,7 @@ void FormMain::OnIterate3Click( wxCommandEvent& WXUNUSED(event) ) for ( it = m_pPropGridManager->GetCurrentPage()-> GetIterator( wxPG_ITERATE_DEFAULT, wxBOTTOM ); !it.AtEnd(); - it-- ) + --it ) { wxPGProperty* p = *it; diff --git a/samples/propgrid/tests.cpp b/samples/propgrid/tests.cpp index f07cf49f24..ffd5bf5abf 100644 --- a/samples/propgrid/tests.cpp +++ b/samples/propgrid/tests.cpp @@ -470,7 +470,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxArrayPGProperty::reverse_iterator it2; - for ( it2 = array.rbegin(); it2 != array.rend(); it2++ ) + for ( it2 = array.rbegin(); it2 != array.rend(); ++it2 ) { wxPGProperty* p = (wxPGProperty*)*it2; RT_MSG(wxString::Format(wxT("Deleting '%s' ('%s')"),p->GetLabel().c_str(),p->GetName().c_str()));