diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-04-15 11:24:26 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-06-24 08:14:01 +0000 |
commit | f291ceaea3d9fffe6794415d8e5ecf44225097fb (patch) | |
tree | 89991ffea9f4820c038965425d4a883411a38304 /src/qml/compiler/qv4compiler.cpp | |
parent | 9ab8b9e4bdf313bb4304be206dd479d4d0848211 (diff) |
QML: Store idObjectDependencies in a QVarLengthArray.
The number of id objects referenced from a function or binding is
often very small. So using a QSet that allocates hash nodes takes more
memory, and is actually slower than using an array.
Change-Id: Id9fa60a860314790284f66318593b3ef938e6eef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compiler.cpp')
-rw-r--r-- | src/qml/compiler/qv4compiler.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index b801009f4e..55d2501024 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -382,8 +382,10 @@ int QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::IR::Function *ir // write QML dependencies quint32 *writtenDeps = (quint32 *)(f + function->dependingIdObjectsOffset); - foreach (int id, irFunction->idObjectDependencies) - *writtenDeps++ = id; + for (int id : irFunction->idObjectDependencies) { + Q_ASSERT(id >= 0); + *writtenDeps++ = static_cast<quint32>(id); + } writtenDeps = (quint32 *)(f + function->dependingContextPropertiesOffset); for (auto property : irFunction->contextObjectPropertyDependencies) { |