diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index cef667fec0e..5916216e578 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -342,12 +342,10 @@ bool CppPreprocessor::checkFile(const QString &absoluteFilePath) const QString CppPreprocessor::resolveFile(const QString &fileName, IncludeType type) { if (type == IncludeGlobal) { - QString fn = m_fileNameCache.value(fileName); - - if (! fn.isEmpty()) - return fn; - - fn = resolveFile_helper(fileName, type); + QHash::ConstIterator it = m_fileNameCache.find(fileName); + if (it != m_fileNameCache.end()) + return it.value(); + const QString fn = resolveFile_helper(fileName, type); m_fileNameCache.insert(fileName, fn); return fn; }