Replace post-increment on iterators with pre-increment
This is a micro-optimization, as pre-increment is at least as efficient as post-increment and typically slightly more so because it doesn't need to make a copy of the iterator, and better conforms to the prevailing C++ style. Closes https://github.com/wxWidgets/wxWidgets/pull/655
This commit is contained in:
committed by
Vadim Zeitlin
parent
f83d16aa46
commit
f423b88ded
@@ -2734,7 +2734,7 @@ unsigned int wxDataViewTreeStore::GetChildren( const wxDataViewItem &item, wxDat
|
||||
if (!node) return 0;
|
||||
|
||||
wxDataViewTreeStoreNodeList::iterator iter;
|
||||
for (iter = node->GetChildren().begin(); iter != node->GetChildren().end(); iter++)
|
||||
for (iter = node->GetChildren().begin(); iter != node->GetChildren().end(); ++iter)
|
||||
{
|
||||
wxDataViewTreeStoreNode* child = *iter;
|
||||
children.Add( child->GetItem() );
|
||||
@@ -2939,7 +2939,7 @@ void wxDataViewTreeCtrl::DeleteChildren( const wxDataViewItem& item )
|
||||
|
||||
wxDataViewItemArray array;
|
||||
wxDataViewTreeStoreNodeList::iterator iter;
|
||||
for (iter = node->GetChildren().begin(); iter != node->GetChildren().end(); iter++)
|
||||
for (iter = node->GetChildren().begin(); iter != node->GetChildren().end(); ++iter)
|
||||
{
|
||||
wxDataViewTreeStoreNode* child = *iter;
|
||||
array.Add( child->GetItem() );
|
||||
|
||||
Reference in New Issue
Block a user