Commit fb72d532 authored by hjk's avatar hjk Committed by Erik Verbruggen

C++: Also cache result of misses in resolveFile()

Change-Id: Ib501bbe16548b194ff5028a1b3ab74c5f0e3230d
Reviewed-by: default avatarErik Verbruggen <>
parent 980fe320
...@@ -342,12 +342,10 @@ bool CppPreprocessor::checkFile(const QString &absoluteFilePath) const ...@@ -342,12 +342,10 @@ bool CppPreprocessor::checkFile(const QString &absoluteFilePath) const
QString CppPreprocessor::resolveFile(const QString &fileName, IncludeType type) QString CppPreprocessor::resolveFile(const QString &fileName, IncludeType type)
{ {
if (type == IncludeGlobal) { if (type == IncludeGlobal) {
QString fn = m_fileNameCache.value(fileName); QHash<QString, QString>::ConstIterator it = m_fileNameCache.find(fileName);
if (it != m_fileNameCache.end())
if (! fn.isEmpty()) return it.value();
return fn; const QString fn = resolveFile_helper(fileName, type);
fn = resolveFile_helper(fileName, type);
m_fileNameCache.insert(fileName, fn); m_fileNameCache.insert(fileName, fn);
return fn; return fn;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment