diff options
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 10 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 2 |
2 files changed, 6 insertions, 6 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); diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 0978af78a9..55053c8733 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -1906,7 +1906,7 @@ void QQmlEnginePrivate::dereferenceScarceResources() // if the refcount is zero, then evaluation of the "top level" // expression must have completed. We can safely release the // scarce resources. - if (scarceResourcesRefCount == 0) { + if (Q_UNLIKELY(scarceResourcesRefCount == 0)) { // iterate through the list and release them all. // note that the actual SRD is owned by the JS engine, // so we cannot delete the SRD; but we can free the |