Skip to content

Commit

Permalink
Simplify if condition for list values
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Oct 1, 2018
1 parent 6574e69 commit d8fcb65
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp
Expand Up @@ -185,11 +185,7 @@ void QgsValueRelationWidgetWrapper::setValue( const QVariant &value )
for ( int i = 0; i < mComboBox->count(); i++ )
{
QVariant v( mComboBox->itemData( i ) );
if ( ( v.isNull() && !value.isNull() ) || ( !v.isNull() && value.isNull() ) )
{
continue;
}
if ( v == value )
if ( v.isNull() == value.isNull() && v == value )
{
idx = i;
break;
Expand Down

0 comments on commit d8fcb65

Please sign in to comment.