Skip to content

Commit

Permalink
Tiny optimisation to hit test by deferring context feature setting un…
Browse files Browse the repository at this point in the history
…til required
  • Loading branch information
nyalldawson committed Feb 1, 2023
1 parent 72877bc commit 73e3c7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgsmaphittest.cpp
Expand Up @@ -164,7 +164,6 @@ void QgsMapHitTest::runHitTestLayer( QgsVectorLayer *vl, SymbolSet &usedSymbols,

while ( fi.nextFeature( f ) )
{
context.expressionContext().setFeature( f );
// filter out elements outside of the polygon
if ( f.hasGeometry() && polygonEngine )
{
Expand All @@ -174,6 +173,8 @@ void QgsMapHitTest::runHitTestLayer( QgsVectorLayer *vl, SymbolSet &usedSymbols,
}
}

context.expressionContext().setFeature( f );

// filter out elements where the expression is false
if ( hasExpression )
{
Expand Down

0 comments on commit 73e3c7b

Please sign in to comment.