From b91569219b901480eb09d648357485e3d9dbf3d1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 10 Apr 2015 15:53:02 +0200 Subject: 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 --- src/qml/qml/qqmlobjectcreator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/qml/qqmlobjectcreator.cpp') 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) { -- cgit v1.2.3