AutoTest: Avoid temporary storing of QMap

Change-Id: I099ffb6931947f72ad242e858d82a109a0da85f9
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
This commit is contained in:
Christian Stenger
2016-02-04 15:03:45 +01:00
parent 6ebd3cc7e8
commit 3f760bad1f

View File

@@ -637,14 +637,11 @@ void TestCodeParser::onQmlDocumentUpdated(const QmlJS::Document::Ptr &document)
return;
}
const CPlusPlus::Snapshot snapshot = CppTools::CppModelManager::instance()->snapshot();
QMap<QString, QString> 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));
}
}