From 4a6154ec912d5b84a556aa731c5b7de8f758ba3d Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 5 Mar 2010 16:26:40 +1000 Subject: Minor perf improvement when running QML script blocks There is no need to capture a property access if a binding is not being evaluated. --- src/declarative/qml/qdeclarativecontextscriptclass.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qdeclarativecontextscriptclass.cpp b/src/declarative/qml/qdeclarativecontextscriptclass.cpp index d6305d8..5fcf4e2 100644 --- a/src/declarative/qml/qdeclarativecontextscriptclass.cpp +++ b/src/declarative/qml/qdeclarativecontextscriptclass.cpp @@ -262,8 +262,9 @@ QDeclarativeContextScriptClass::property(Object *object, const Identifier &name) } } - ep->capturedProperties << - QDeclarativeEnginePrivate::CapturedProperty(bindContext, -1, lastPropertyIndex + cp->notifyIndex); + if (ep->captureProperties) + ep->capturedProperties << QDeclarativeEnginePrivate::CapturedProperty(bindContext, -1, lastPropertyIndex + cp->notifyIndex); + return Value(scriptEngine, rv); } else if(lastDefaultObject != -1) { -- cgit v0.12