diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-05 06:23:41 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-08-05 06:23:41 (GMT) |
commit | 6e682a64153f0b3f96a412a72dab0158e3f8e365 (patch) | |
tree | 52ff7c6b6cf4485935029d6de0b9ef1601e12a2a /src/declarative/qml/qmlcontext.cpp | |
parent | 3c85728f2cb69817d4b72d3aab16b7a7fe6bdbf0 (diff) | |
download | Qt-6e682a64153f0b3f96a412a72dab0158e3f8e365.zip Qt-6e682a64153f0b3f96a412a72dab0158e3f8e365.tar.gz Qt-6e682a64153f0b3f96a412a72dab0158e3f8e365.tar.bz2 |
Use a linked list instead of a QSet<> to track expressions
While the QSet<> wasn't that expensive, the QmlContext only tracks the
expressions to stop programmers doing something "stupid" so any overhead is
unacceptable. This does give a measurable improvement.
Diffstat (limited to 'src/declarative/qml/qmlcontext.cpp')
-rw-r--r-- | src/declarative/qml/qmlcontext.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index 365ad6d..8a2732d 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE QmlContextPrivate::QmlContextPrivate() : parent(0), engine(0), isInternal(false), notifyIndex(-1), - highPriorityCount(0), idValues(0), idValueCount(0) + highPriorityCount(0), expressions(0), idValues(0), idValueCount(0) { } @@ -278,11 +278,15 @@ QmlContext::~QmlContext() (*iter)->d_func()->parent = 0; } - for (QSet<QmlExpression *>::ConstIterator iter = - d->childExpressions.begin(); - iter != d->childExpressions.end(); - ++iter) { - (*iter)->d_func()->ctxt = 0; + QmlExpressionPrivate *expression = d->expressions; + while (expression) { + QmlExpressionPrivate *nextExpression = expression->nextExpression; + + expression->ctxt = 0; + expression->prevExpression = 0; + expression->nextExpression = 0; + + expression = nextExpression; } for (int ii = 0; ii < d->contextObjects.count(); ++ii) { |