diff options
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
-rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index c809d497fd..773659b431 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -264,20 +264,16 @@ void CompilationUnit::markObjects(QV4::MarkStack *markStack) } } -IdentifierHash CompilationUnit::namedObjectsPerComponent(int componentObjectIndex) +IdentifierHash CompilationUnit::createNamedObjectsPerComponent(int componentObjectIndex) { - auto it = namedObjectsPerComponentCache.find(componentObjectIndex); - if (it == namedObjectsPerComponentCache.end()) { - IdentifierHash namedObjectCache(engine); - const CompiledData::Object *component = data->objectAt(componentObjectIndex); - const quint32_le *namedObjectIndexPtr = component->namedObjectsInComponentTable(); - for (quint32 i = 0; i < component->nNamedObjectsInComponent; ++i, ++namedObjectIndexPtr) { - const CompiledData::Object *namedObject = data->objectAt(*namedObjectIndexPtr); - namedObjectCache.add(runtimeStrings[namedObject->idNameIndex], namedObject->id); - } - it = namedObjectsPerComponentCache.insert(componentObjectIndex, namedObjectCache); - } - return *it; + IdentifierHash namedObjectCache(engine); + const CompiledData::Object *component = data->objectAt(componentObjectIndex); + const quint32_le *namedObjectIndexPtr = component->namedObjectsInComponentTable(); + for (quint32 i = 0; i < component->nNamedObjectsInComponent; ++i, ++namedObjectIndexPtr) { + const CompiledData::Object *namedObject = data->objectAt(*namedObjectIndexPtr); + namedObjectCache.add(runtimeStrings[namedObject->idNameIndex], namedObject->id); + } + return *namedObjectsPerComponentCache.insert(componentObjectIndex, namedObjectCache); } void CompilationUnit::finalizeCompositeType(QQmlEnginePrivate *qmlEngine) |