Commit 35bcccb5 authored by Leandro Melo's avatar Leandro Melo

C++: Remaining fixes in symbol finder

Should have gone in the previous fix commit...

Change-Id: Ibca55cbd6fd58caee7d61f5e8f8c37f67391c597
Reviewed-by: default avatarLeandro Melo <leandro.melo@nokia.com>
parent 09f2c7b8
......@@ -63,7 +63,7 @@ public:
} // end of anonymous namespace
static const int kMaxSize = 2;
static const int kMaxSize = 10;
SymbolFinder::SymbolFinder()
{}
......@@ -292,9 +292,11 @@ QStringList SymbolFinder::fileIterationOrder(const QString &referenceFile, const
insertCache(referenceFile, doc->fileName());
}
QStringList files = m_filePriorityCache.value(referenceFile).values();
trackCacheUse(referenceFile);
return m_filePriorityCache.value(referenceFile).values();
return files;
}
void SymbolFinder::checkCacheConsistency(const QString &referenceFile, const Snapshot &snapshot)
......@@ -336,7 +338,7 @@ void SymbolFinder::trackCacheUse(const QString &referenceFile)
// We don't want this to grow too much.
if (m_recent.size() > kMaxSize) {
const QString &oldest = m_recent.front();
const QString &oldest = m_recent.takeFirst();
m_filePriorityCache.remove(oldest);
m_fileMetaCache.remove(oldest);
}
......
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