QmlDesigner: Remove second lookup

Change-Id: I9ba1c5e5de053302aed2c12560555e526f1dd87c
Reviewed-by: Aleksei German <aleksei.german@qt.io>
This commit is contained in:
Marco Bubke
2025-01-06 11:42:55 +01:00
parent e1e7854279
commit 30e40a99ca

View File

@@ -331,10 +331,11 @@ void StylesheetMerger::replaceRootNode(ModelNode& templateRootNode)
// Move the newly created nodes to the correct position in the parent node
void StylesheetMerger::adjustNodeIndex(ModelNode &node)
{
if (!m_reparentInfoHash.contains(node.id()))
auto found = m_reparentInfoHash.find(node.id());
if (found == m_reparentInfoHash.end())
return;
ReparentInfo info = m_reparentInfoHash.value(node.id());
ReparentInfo info = *found;
if (info.parentIndex < 0)
return;