Don't call wxVariant::MakeNull() unnecessary

Simplify recently added code in wxDataViewModel::Compare().

No real changes.
This commit is contained in:
Vadim Zeitlin
2020-04-17 23:25:30 +02:00
parent 1fa1aa5937
commit 84fb5f38be

View File

@@ -334,8 +334,13 @@ int wxDataViewModel::Compare( const wxDataViewItem &item1, const wxDataViewItem
unsigned int column, bool ascending ) const
{
wxVariant value1,value2;
HasValue(item1, column) ? GetValue( value1, item1, column ) : value1.MakeNull();
HasValue(item2, column) ? GetValue( value2, item2, column ) : value2.MakeNull();
// Avoid calling GetValue() for the cells that are not supposed to have any
// value, this might be unexpected.
if ( HasValue(item1, column) )
GetValue( value1, item1, column );
if ( HasValue(item2, column) )
GetValue( value2, item2, column );
if (!ascending)
{