aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-10 15:53:02 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-16 10:56:06 +0000
commitb91569219b901480eb09d648357485e3d9dbf3d1 (patch)
tree12092f2d0d2f395f91f9327004bd2791e7eea508 /src/qml/qml/qqmlobjectcreator.cpp
parent497ccdc843975bfe20f5b24e083d17f01012efb9 (diff)
Speed up creation of objects that don't import scripts
In the common case of no 'import "Foo.js" as Bar' we can avoid the creation of the JS array that holds the script references. Change-Id: I6704bd9efaf8681f939a148b2cb0a1de2cb22d80 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index a32dc9e0a9..76c4537103 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -206,7 +206,7 @@ QObject *QQmlObjectCreator::create(int subComponentIndex, QObject *parent, QQmlI
}
context->setIdPropertyData(mapping);
- if (subComponentIndex == -1) {
+ if (subComponentIndex == -1 && compiledData->scripts.count()) {
QV4::ScopedObject scripts(scope, v4->newArrayObject(compiledData->scripts.count()));
context->importedScripts.set(v4, scripts);
for (int i = 0; i < compiledData->scripts.count(); ++i) {