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 c5f65359d8975dd03f180e8287c701933713f6ae
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/core/qgsproperty.cpp
@@ -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.
You can’t perform that action at this time.