summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-06-06 20:58:47 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-06-06 20:58:53 +0200
commitd17b1947b5fb1b612e781e8af57f53f947ac13ba (patch)
tree7eb842460e13833e2e26c374af564d6531fb08e1
parent583dcc6d31bb44d9d36c6a18dd71d54cbb6d5683 (diff)
downloadqtscript-d17b1947b5fb1b612e781e8af57f53f947ac13ba.tar.gz
QScriptValueIterator: replace a QLinkedList with a std::list
The payload type apparently doesn't like to be destroyed unless some magic foo is enabled (cf. ~QScriptValueIteratorPrivate()). Since the code also allows to remove items in the middle, we need a container that guarantees no copies (thus, deletions) happen at all. That leaves a vector<unique_ptr>, or a std::list. Since this is a deprecated module, use the least-intrusive option: std::list Change-Id: Iaadc71959814959bf7ba1a225f375d64edbd9785 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
-rw-r--r--src/script/api/qscriptvalueiterator.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/api/qscriptvalueiterator.cpp b/src/script/api/qscriptvalueiterator.cpp
index c470664..a1e3b21 100644
--- a/src/script/api/qscriptvalueiterator.cpp
+++ b/src/script/api/qscriptvalueiterator.cpp
@@ -28,14 +28,14 @@
#include "qscriptengine.h"
#include "qscriptengine_p.h"
#include "qscriptvalue_p.h"
-#include "qlinkedlist.h"
-
#include "JSObject.h"
#include "PropertyNameArray.h"
#include "JSArray.h"
#include "JSFunction.h"
+#include <list>
+
QT_BEGIN_NAMESPACE
/*!
@@ -118,16 +118,16 @@ public:
JSC::PropertyNameArray::const_iterator propertyNamesIt = propertyNamesArray.begin();
for(; propertyNamesIt != propertyNamesArray.end(); ++propertyNamesIt) {
- propertyNames.append(*propertyNamesIt);
+ propertyNames.push_back(*propertyNamesIt);
}
it = propertyNames.begin();
initialized = true;
}
QScriptValue objectValue;
- QLinkedList<JSC::Identifier> propertyNames;
- QLinkedList<JSC::Identifier>::iterator it;
- QLinkedList<JSC::Identifier>::iterator current;
+ std::list<JSC::Identifier> propertyNames;
+ std::list<JSC::Identifier>::iterator it;
+ std::list<JSC::Identifier>::iterator current;
bool initialized;
};