Skip to content

Commit

Permalink
Code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
espinafre authored and nyalldawson committed Jun 2, 2020
1 parent e16ece7 commit 5347759
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2343,7 +2343,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist, Flags flags )

QString fieldname = mAttributeFields.at( idx ).name();

if ( mGeneratedValues.contains( idx ) && !mGeneratedValues.value( idx, QString() ).isEmpty() )
if ( !mGeneratedValues.value( idx, QString() ).isEmpty() )
{
QgsDebugMsg( QStringLiteral( "Skipping field %1 (idx %2) which is GENERATED." ).arg( fieldname, idx ) );
continue;
Expand Down Expand Up @@ -2375,12 +2375,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist, Flags flags )

if ( i == flist.size() )
{
// generated values override everything.
if ( !mGeneratedValues[idx].isEmpty() )
{
values += delim + defVal;
}
else if ( qgsVariantEqual( v, defVal ) )
if ( qgsVariantEqual( v, defVal ) )
{
if ( defVal.isNull() )
{
Expand Down

0 comments on commit 5347759

Please sign in to comment.