Skip to content
Permalink
Browse files
Cache field lookup when evaluating field-based property values
  • Loading branch information
nyalldawson committed Dec 2, 2017
1 parent d1a71f0 commit c5f6535
Showing 1 changed file with 3 additions and 4 deletions.
@@ -448,14 +448,13 @@ QVariant QgsProperty::propertyValue( const QgsExpressionContext &context, const
*ok = true;
return f.attribute( d->cachedFieldIdx );
}

int fieldIdx = f.fieldNameIndex( d->fieldName );
if ( fieldIdx < 0 )
prepare( context );
if ( d->cachedFieldIdx < 0 )
return defaultValue;

if ( ok )
*ok = true;
return f.attribute( fieldIdx );
return f.attribute( d->cachedFieldIdx );
}

case ExpressionBasedProperty:

0 comments on commit c5f6535

Please sign in to comment.