logic: Fixed updated files detection performance in project refresh

This commit is contained in:
Eberhard Graether
2018-04-20 10:00:37 +02:00
parent 5edaedfd37
commit e9877acf80
+28 -21
View File
@@ -501,34 +501,41 @@ RefreshInfo Project::getRefreshInfoForUpdatedFiles() const
for (const std::shared_ptr<SourceGroup>& sourceGroup : m_sourceGroups)
{
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
if (sourceGroup->getStatus() != SOURCE_GROUP_STATUS_ENABLED)
{
for (const FileInfo& info : fileInfos)
continue;
}
std::set<FilePath> indexedPaths = sourceGroup->getIndexedPaths();
std::set<FilePathFilter> excludeFilters = sourceGroup->getExcludeFilters();
for (const FileInfo& info : fileInfos)
{
bool isInIndexedPaths = false;
for (const FilePath& indexedPath : indexedPaths)
{
bool isInIndexedPaths = false;
for (const FilePath& indexedPath : sourceGroup->getIndexedPaths())
if (indexedPath == info.path || indexedPath.contains(info.path))
{
if (indexedPath == info.path || indexedPath.contains(info.path))
isInIndexedPaths = true;
break;
}
}
if (isInIndexedPaths)
{
for (const FilePathFilter& excludeFilter : excludeFilters)
{
if (excludeFilter.isMatching(info.path))
{
isInIndexedPaths = true;
isInIndexedPaths = false;
break;
}
}
if (isInIndexedPaths)
{
for (const FilePathFilter& excludeFilter : sourceGroup->getExcludeFilters())
{
if (excludeFilter.isMatching(info.path))
{
isInIndexedPaths = false;
break;
}
}
}
if (isInIndexedPaths)
{
alreadyIndexedPaths.insert(info.path);
}
}
if (isInIndexedPaths)
{
alreadyIndexedPaths.insert(info.path);
}
}
}