Skip to content

Commit

Permalink
[qt6][posgresql] Remove use of QSet::const_iterator operator--(), gon…
Browse files Browse the repository at this point in the history
…e in qt6
  • Loading branch information
nirvn committed Jul 17, 2021
1 parent 1edf16d commit c801957
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2672,14 +2672,14 @@ bool QgsPostgresProvider::deleteFeatures( const QgsFeatureIds &ids )
conn->begin();

QgsFeatureIds chunkIds;
QgsFeatureIds::const_iterator lastId = ids.constEnd();
--lastId;

const int countIds = ids.size();
int i = 0;
for ( QgsFeatureIds::const_iterator it = ids.constBegin(); it != ids.constEnd(); ++it )
{
// create chunks of fids to delete, the last chunk may be smaller
chunkIds.insert( *it );
if ( chunkIds.size() < 5000 && it != lastId )
i++;
if ( chunkIds.size() < 5000 && i < countIds )
continue;

const QString sql = QStringLiteral( "DELETE FROM %1 WHERE %2" )
Expand Down

0 comments on commit c801957

Please sign in to comment.