logic: improved performance of code blocks indexed header detection

This commit is contained in:
mlangkabel
2018-06-15 13:35:27 +02:00
parent e4000e88be
commit f0b423b319
4 changed files with 71 additions and 7 deletions
@@ -312,9 +312,13 @@ std::vector<FilePath> QtProjectWizzardContentIndexedHeaderPaths::getIndexedPaths
{
if (std::shared_ptr<Codeblocks::Project> codeblocksProject = Codeblocks::Project::load(codeblocksProjectPath))
{
for (const FilePath& path : codeblocksProject->getAllSourceFilePathsCanonical(settings))
OrderedCache<FilePath, FilePath> canonicalDirectoryPathCache([](const FilePath& path) {
return path.getCanonical();
});
for (const FilePath& path : codeblocksProject->getAllSourceFilePaths(settings))
{
indexedHeaderPaths.insert(path.getCanonical().getParentDirectory());
indexedHeaderPaths.insert(canonicalDirectoryPathCache.getValue(path.getParentDirectory()));
}
utility::append(indexedHeaderPaths, codeblocksProject->getAllCxxHeaderSearchPathsCanonical());
}