mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Cache field lookup when evaluating field-based property values
This commit is contained in:
parent
d1a71f0971
commit
c5f65359d8
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user