Optimize allocating default cells in wxPGProperty::EnsureCells
Use embedded 'resize' function to alloc new slots at once instead of doing this in an iterative way. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1607,11 +1607,8 @@ void wxPGProperty::EnsureCells( unsigned int column )
|
||||
defaultCell = pg->GetCategoryDefaultCell();
|
||||
}
|
||||
|
||||
// TODO: Replace with resize() call
|
||||
unsigned int cellCountMax = column+1;
|
||||
|
||||
for ( unsigned int i=m_cells.size(); i<cellCountMax; i++ )
|
||||
m_cells.push_back(defaultCell);
|
||||
// Alloc new default cells.
|
||||
m_cells.resize(column+1, defaultCell);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user