C++: Remaining fixes in symbol finder

Should have gone in the previous fix commit...

Change-Id: Ibca55cbd6fd58caee7d61f5e8f8c37f67391c597
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
Leandro Melo
2012-01-23 20:49:00 +01:00
parent 09f2c7b8f3
commit 35bcccb500

View File

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