forked from qt-creator/qt-creator
Utils: Cache FilePath::qHash
Calling toCaseFolded is expensive if the same filepath is hashed often, so we calculate the hash value once and cache the result. One such case was found to happen when parsing tests, as the cpp parser is queried a lot and it uses hash maps / sets with filepaths. Change-Id: Ic3ca7f09e8f108f5a89b3fdb17743ae7c3258001 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -277,6 +277,7 @@ private:
|
||||
unsigned int m_pathLen = 0;
|
||||
unsigned short m_schemeLen = 0;
|
||||
unsigned short m_hostLen = 0;
|
||||
mutable size_t m_hash = 0;
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT DeviceFileHooks
|
||||
|
||||
Reference in New Issue
Block a user