diff options
Diffstat (limited to 'src/qml/qml/qqmlbinding.cpp')
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index f91378b758..e8ddfecbe3 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -226,9 +226,6 @@ bool QQmlBinding::write(const QQmlPropertyData &core, Q_ASSERT(m_target.data()); Q_ASSERT(core.coreIndex != -1); - QQmlEngine *engine = context()->engine; - QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine); - #define QUICK_STORE(cpptype, conversion) \ { \ cpptype o = (conversion); \ @@ -239,7 +236,7 @@ bool QQmlBinding::write(const QQmlPropertyData &core, } \ - if (!isUndefined && !core.isValueTypeVirtual()) { + if (Q_LIKELY(!isUndefined && !core.isValueTypeVirtual())) { switch (core.propType) { case QMetaType::Int: if (result.isInteger()) @@ -270,6 +267,9 @@ bool QQmlBinding::write(const QQmlPropertyData &core, } #undef QUICK_STORE + QQmlEngine *engine = context()->engine; + QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine); + int type = core.isValueTypeVirtual() ? core.valueTypePropType : core.propType; QQmlJavaScriptExpression::DeleteWatcher watcher(this); @@ -497,7 +497,7 @@ QQmlPropertyData QQmlBinding::getPropertyData() const Q_ASSERT(propertyData); QQmlPropertyData d = *propertyData; - if (valueTypeIndex != -1) { + if (Q_UNLIKELY(valueTypeIndex != -1)) { const QMetaObject *valueTypeMetaObject = QQmlValueTypeFactory::metaObjectForMetaType(d.propType); Q_ASSERT(valueTypeMetaObject); QMetaProperty vtProp = valueTypeMetaObject->property(valueTypeIndex); |