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)); } }