Skip to content

Commit

Permalink
const copy before for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav authored and nyalldawson committed Jun 20, 2019
1 parent 9290dff commit 840ab03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgsofflineediting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,8 @@ QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlit
copySymbology( layer, newLayer );

//remove constrainst of fields that use defaultValueClauses from provider on original
for ( const QgsField &field : layer->fields() )
const auto fields = layer->fields();
for ( const QgsField &field : fields )
{
if ( !layer->dataProvider()->defaultValueClause( layer->fields().fieldOriginIndex( layer->fields().indexOf( field.name() ) ) ).isEmpty() )
{
Expand Down

0 comments on commit 840ab03

Please sign in to comment.