From 225d73e85c27707914c2b001319bcc774a9c3447 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Fri, 4 Dec 2020 13:36:03 +0100 Subject: [PATCH] Only index the context once --- kdevplatform/language/highlighting/codehighlighting.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kdevplatform/language/highlighting/codehighlighting.cpp b/kdevplatform/language/highlighting/codehighlighting.cpp index d478fbb115..589ea5c2b1 100644 --- a/kdevplatform/language/highlighting/codehighlighting.cpp +++ b/kdevplatform/language/highlighting/codehighlighting.cpp @@ -312,8 +312,9 @@ void CodeHighlightingInstance::highlightDUChain(DUContext* context, QHashtype() == DUContext::Other || context->type() == DUContext::Function) { - m_functionColorsForDeclarations[IndexedDUContext(context)] = colorsForDeclarations; - m_functionDeclarationsForColors[IndexedDUContext(context)] = declarationsForColors; + const auto indexed = IndexedDUContext(context); + m_functionColorsForDeclarations[indexed] = colorsForDeclarations; + m_functionDeclarationsForColors[indexed] = declarationsForColors; } const QVector children = context->childContexts(); -- GitLab