forked from qt-creator/qt-creator
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:
@@ -63,7 +63,7 @@ public:
|
|||||||
|
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
|
|
||||||
static const int kMaxSize = 2;
|
static const int kMaxSize = 10;
|
||||||
|
|
||||||
SymbolFinder::SymbolFinder()
|
SymbolFinder::SymbolFinder()
|
||||||
{}
|
{}
|
||||||
@@ -292,9 +292,11 @@ QStringList SymbolFinder::fileIterationOrder(const QString &referenceFile, const
|
|||||||
insertCache(referenceFile, doc->fileName());
|
insertCache(referenceFile, doc->fileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList files = m_filePriorityCache.value(referenceFile).values();
|
||||||
|
|
||||||
trackCacheUse(referenceFile);
|
trackCacheUse(referenceFile);
|
||||||
|
|
||||||
return m_filePriorityCache.value(referenceFile).values();
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SymbolFinder::checkCacheConsistency(const QString &referenceFile, const Snapshot &snapshot)
|
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.
|
// We don't want this to grow too much.
|
||||||
if (m_recent.size() > kMaxSize) {
|
if (m_recent.size() > kMaxSize) {
|
||||||
const QString &oldest = m_recent.front();
|
const QString &oldest = m_recent.takeFirst();
|
||||||
m_filePriorityCache.remove(oldest);
|
m_filePriorityCache.remove(oldest);
|
||||||
m_fileMetaCache.remove(oldest);
|
m_fileMetaCache.remove(oldest);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user