forked from qt-creator/qt-creator
ProjectExplorer: prepare for parallelization of recursive file scan
Change-Id: Ia2db3ef0fe619907c1ed30b8f984de4de04cc477 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -83,12 +83,17 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc)
|
||||
|
||||
// Cache mime check result for speed up
|
||||
if (!isIgnored) {
|
||||
auto it = m_mimeBinaryCache.find(mimeType.name());
|
||||
if (it != m_mimeBinaryCache.end()) {
|
||||
if (auto it = m_mimeBinaryCache.get<std::optional<bool>>(
|
||||
[mimeType](const QHash<QString, bool> &cache) -> std::optional<bool> {
|
||||
auto it = cache.find(mimeType.name());
|
||||
if (it != cache.end())
|
||||
return *it;
|
||||
return {};
|
||||
})) {
|
||||
isIgnored = *it;
|
||||
} else {
|
||||
isIgnored = TreeScanner::isMimeBinary(mimeType, fn);
|
||||
m_mimeBinaryCache[mimeType.name()] = isIgnored;
|
||||
m_mimeBinaryCache.writeLocked()->insert(mimeType.name(), isIgnored);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user