diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-12-20 04:29:19 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-12-21 04:29:02 (GMT) |
commit | 1476bf8d45b4f1ab6c56770939eb81c4c1b390ad (patch) | |
tree | aeb94ca0a60e994be3e3f4eec55252d2fa505812 | |
parent | 6b37f71b318445a338c4afe5ba8a5ccaff573518 (diff) | |
download | Qt-1476bf8d45b4f1ab6c56770939eb81c4c1b390ad.zip Qt-1476bf8d45b4f1ab6c56770939eb81c4c1b390ad.tar.gz Qt-1476bf8d45b4f1ab6c56770939eb81c4c1b390ad.tar.bz2 |
Optimize name lookup for QDeclarativeProperty.
If the property is constructed by passing in the property name (and
we've verified that it is valid), we can cache that name immediately
rather than reconstructing it on the first call to name().
Task-number: QTBUG-15331
Reviewed-by: Martin Jones
-rw-r--r-- | src/declarative/qml/qdeclarativeproperty.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index 60edd64..8eaa98b 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -315,6 +315,8 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name if (property && !(property->flags & QDeclarativePropertyCache::Data::IsFunction)) { object = currentObject; core = *property; + nameCache = terminal; + isNameCached = true; } } |