File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -318,22 +318,22 @@ void QgsSnappingUtils::prepareIndex( const QList<QgsVectorLayer*>& layers )
318
318
if ( willUseIndex ( vl ) && !locatorForLayer ( vl )->hasIndex () )
319
319
layersToIndex << vl;
320
320
}
321
- if ( layersToIndex.isEmpty () )
322
- return ;
323
-
324
- // build indexes
325
- QTime t; t.start ();
326
- int i = 0 ;
327
- prepareIndexStarting ( layersToIndex.count () );
328
- Q_FOREACH ( QgsVectorLayer* vl, layersToIndex )
321
+ if ( !layersToIndex.isEmpty () )
329
322
{
330
- QTime tt; tt.start ();
331
- if ( !locatorForLayer ( vl )->init ( mStrategy == IndexHybrid ? 1000000 : -1 ) )
332
- mHybridNonindexableLayers .insert ( vl->id () );
333
- QgsDebugMsg ( QString ( " Index init: %1 ms (%2)" ).arg ( tt.elapsed () ).arg ( vl->id () ) );
334
- prepareIndexProgress ( ++i );
323
+ // build indexes
324
+ QTime t; t.start ();
325
+ int i = 0 ;
326
+ prepareIndexStarting ( layersToIndex.count () );
327
+ Q_FOREACH ( QgsVectorLayer* vl, layersToIndex )
328
+ {
329
+ QTime tt; tt.start ();
330
+ if ( !locatorForLayer ( vl )->init ( mStrategy == IndexHybrid ? 1000000 : -1 ) )
331
+ mHybridNonindexableLayers .insert ( vl->id () );
332
+ QgsDebugMsg ( QString ( " Index init: %1 ms (%2)" ).arg ( tt.elapsed () ).arg ( vl->id () ) );
333
+ prepareIndexProgress ( ++i );
334
+ }
335
+ QgsDebugMsg ( QString ( " Prepare index total: %1 ms" ).arg ( t.elapsed () ) );
335
336
}
336
- QgsDebugMsg ( QString ( " Prepare index total: %1 ms" ).arg ( t.elapsed () ) );
337
337
mIsIndexing = false ;
338
338
}
339
339
You can’t perform that action at this time.
0 commit comments