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:
Artur Wieczorek
2014-08-29 21:53:27 +00:00
parent 7e859ec6c9
commit f8aacfa02c

View File

@@ -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);
}
}