From 3f760bad1f21e8af8d9899ec7f1260ef31e8d88f Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 4 Feb 2016 15:03:45 +0100 Subject: [PATCH] AutoTest: Avoid temporary storing of QMap Change-Id: I099ffb6931947f72ad242e858d82a109a0da85f9 Reviewed-by: Niels Weber --- src/plugins/autotest/testcodeparser.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index 9cbe82f0901..e8e379ed1f0 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -637,14 +637,11 @@ void TestCodeParser::onQmlDocumentUpdated(const QmlJS::Document::Ptr &document) return; } const CPlusPlus::Snapshot snapshot = CppTools::CppModelManager::instance()->snapshot(); - QMap referencingFiles = m_model->referencingFiles(); - if (referencingFiles.contains(fileName)) { - const QString &referencingFile = referencingFiles.value(fileName); - if (!referencingFile.isEmpty() && snapshot.contains(referencingFile)) { - qCDebug(LOG) << "calling scanForTests with cached referencing files" - << "(onQmlDocumentUpdated)"; - scanForTests(QStringList(referencingFile)); - } + const QString &referencingFile = m_model->referencingFiles().value(fileName); + if (!referencingFile.isEmpty() && snapshot.contains(referencingFile)) { + qCDebug(LOG) << "calling scanForTests with cached referencing files" + << "(onQmlDocumentUpdated)"; + scanForTests(QStringList(referencingFile)); } }