data: Fixed indexing performance regression in FileRegister
* removed debug cout uses * add source paths first as header search paths
This commit is contained in:
@@ -13,8 +13,9 @@ FileRegister::FileRegister(
|
||||
, m_indexedPaths(indexedPaths)
|
||||
, m_excludedPaths(excludedPaths)
|
||||
, m_hasFilePathCache(
|
||||
[&](const FilePath& filePath)
|
||||
[&](const std::string& f)
|
||||
{
|
||||
const FilePath filePath(f);
|
||||
bool ret = false;
|
||||
|
||||
if (filePath == m_currentPath)
|
||||
@@ -100,5 +101,5 @@ bool FileRegister::fileIsIndexed(const FilePath& filePath) const
|
||||
|
||||
bool FileRegister::hasFilePath(const FilePath& filePath) const
|
||||
{
|
||||
return m_hasFilePathCache.getValue(filePath);
|
||||
return m_hasFilePathCache.getValue(filePath.str());
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <set>
|
||||
|
||||
#include "utility/file/FileRegisterStateData.h"
|
||||
#include "utility/OrderedCache.h"
|
||||
#include "utility/UnorderedCache.h"
|
||||
|
||||
class FileRegister
|
||||
{
|
||||
@@ -29,7 +29,7 @@ private:
|
||||
const FilePath& m_currentPath;
|
||||
const std::set<FilePath> m_indexedPaths;
|
||||
const std::set<FilePath> m_excludedPaths;
|
||||
mutable OrderedCache<FilePath, bool> m_hasFilePathCache;
|
||||
mutable UnorderedCache<std::string, bool> m_hasFilePathCache;
|
||||
};
|
||||
|
||||
#endif // FILE_REGISTER_H
|
||||
|
||||
Reference in New Issue
Block a user