From 2e6f7f362e62c3285e7d395aca607502c8e8160e Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 21 Apr 2016 15:30:50 +0200 Subject: V4: 'Cache' enumeration end instead of calling a method. Saves ~2600 instructions on Linux/x86_64 for a normal instantiation of QV4::Heap::QtObject. Change-Id: I20c9311a96fd76911536153ddd1605500c6ac451 Reviewed-by: Lars Knoll --- src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml') diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index f4e980eefb..b90fd7eb17 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -89,9 +89,9 @@ Heap::QtObject::QtObject(QQmlEngine *qmlEngine) const QMetaObject *qtMetaObject = StaticQtMetaObject::get(); ScopedString str(scope); ScopedValue v(scope); - for (int ii = 0; ii < qtMetaObject->enumeratorCount(); ++ii) { + for (int ii = 0, eii = qtMetaObject->enumeratorCount(); ii < eii; ++ii) { QMetaEnum enumerator = qtMetaObject->enumerator(ii); - for (int jj = 0; jj < enumerator.keyCount(); ++jj) { + for (int jj = 0, ejj = enumerator.keyCount(); jj < ejj; ++jj) { o->put((str = scope.engine->newString(QString::fromUtf8(enumerator.key(jj)))), (v = QV4::Primitive::fromInt32(enumerator.value(jj)))); } } -- cgit v1.2.3