Remove unnecessary members
authorAaron Kennedy <aaron.kennedy@nokia.com>
Fri, 30 Sep 2011 00:10:13 +0000 (10:10 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 30 Sep 2011 08:37:05 +0000 (10:37 +0200)
Change-Id: I9dcdd2333c42aff8a648d5caaa4411c342923d42
Task-number: QTBUG-21151
Reviewed-on: http://codereview.qt-project.org/5822
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
src/declarative/qml/qdeclarativevme.cpp
src/declarative/qml/qdeclarativevme_p.h

index bf81ae4..f8405be 100644 (file)
@@ -116,8 +116,6 @@ void QDeclarativeVME::init(QDeclarativeContextData *ctxt, QDeclarativeCompiledDa
 
     rootContext = 0;
     engine = ctxt->engine;
-    bindValuesCount = 0;
-    parserStatusCount = 0;
 }
 
 bool QDeclarativeVME::initDeferred(QObject *object)
@@ -151,8 +149,6 @@ bool QDeclarativeVME::initDeferred(QObject *object)
 
     rootContext = 0;
     engine = ctxt->engine;
-    bindValuesCount = 0;
-    parserStatusCount = 0;
 
     return true;
 }
@@ -1248,31 +1244,28 @@ bool QDeclarativeVME::complete(const Interrupt &interrupt)
 {
     ActiveVMERestorer restore(this, QDeclarativeEnginePrivate::get(engine));
 
-    while (bindValuesCount < bindValues.count()) {
-        if(bindValues.at(bindValuesCount)) {
-            QDeclarativeAbstractBinding *b = bindValues.at(bindValuesCount);
+    while (!bindValues.isEmpty()) {
+        QDeclarativeAbstractBinding *b = bindValues.pop();
+
+        if(b) {
             b->m_mePtr = 0;
             b->setEnabled(true, QDeclarativePropertyPrivate::BypassInterceptor | 
                                 QDeclarativePropertyPrivate::DontRemoveBinding);
         }
-        ++bindValuesCount;
 
         if (interrupt.shouldInterrupt())
             return false;
     }
     bindValues.deallocate();
 
-    while (parserStatusCount < parserStatus.count()) {
-        QDeclarativeParserStatus *status = 
-            parserStatus.at(parserStatus.count() - parserStatusCount - 1);
+    while (!parserStatus.isEmpty()) {
+        QDeclarativeParserStatus *status = parserStatus.pop();
 
         if (status && status->d) {
             status->d = 0;
             status->componentComplete();
         }
         
-        ++parserStatusCount;
-
         if (interrupt.shouldInterrupt())
             return false;
     }
index 3d79f9d..80c02b1 100644 (file)
@@ -141,8 +141,6 @@ private:
     QFiniteStack<QObject *> objects;
     QFiniteStack<QDeclarativeVMETypes::List> lists;
 
-    int bindValuesCount;
-    int parserStatusCount;
     QFiniteStack<QDeclarativeAbstractBinding *> bindValues;
     QFiniteStack<QDeclarativeParserStatus *> parserStatus;
     QDeclarativeContextData *rootContext;