Use empty() member function to determine if arrays are empty in wxPG.
Use this dedicated function instead of checking if size() function returns zero/non-zero value.
This commit is contained in:
@@ -722,7 +722,7 @@ bool wxPropertyGrid::DoAddToSelection( wxPGProperty* prop, int selFlags )
|
||||
|
||||
wxArrayPGProperty& selection = m_pState->m_selection;
|
||||
|
||||
if ( !selection.size() )
|
||||
if ( selection.empty() )
|
||||
{
|
||||
return DoSelectProperty(prop, selFlags);
|
||||
}
|
||||
@@ -935,7 +935,7 @@ bool wxPropertyGrid::AddToSelectionFromInputEvent( wxPGProperty* prop,
|
||||
void wxPropertyGrid::DoSetSelection( const wxArrayPGProperty& newSelection,
|
||||
int selFlags )
|
||||
{
|
||||
if ( newSelection.size() > 0 )
|
||||
if ( !newSelection.empty() )
|
||||
{
|
||||
if ( !DoSelectProperty(newSelection[0], selFlags) )
|
||||
return;
|
||||
@@ -4065,10 +4065,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
||||
wxArrayPGProperty prevSelection = m_pState->m_selection;
|
||||
wxPGProperty* prevFirstSel;
|
||||
|
||||
if ( prevSelection.size() > 0 )
|
||||
prevFirstSel = prevSelection[0];
|
||||
else
|
||||
prevFirstSel = NULL;
|
||||
prevFirstSel = prevSelection.empty()? NULL: prevSelection[0];
|
||||
|
||||
if ( prevFirstSel && prevFirstSel->HasFlag(wxPG_PROP_BEING_DELETED) )
|
||||
prevFirstSel = NULL;
|
||||
@@ -6251,7 +6248,7 @@ void wxPGChoicesData::Clear()
|
||||
|
||||
void wxPGChoicesData::CopyDataFrom( wxPGChoicesData* data )
|
||||
{
|
||||
wxASSERT( m_items.size() == 0 );
|
||||
wxASSERT( m_items.empty() );
|
||||
|
||||
m_items = data->m_items;
|
||||
}
|
||||
|
Reference in New Issue
Block a user