CppEditor: Keep track of FilePath instead of QString

... in CppSourceProcessor::mergeEnvironment().

This is functionally equivalent as the scheme/host bits are identical
within normal projects.

The temporaries for path() were responsible for 10% of the time in the
function, in total ~0.5% of the C++ parsing in my Creator-in-Creator setup.

Change-Id: I7f4f163f0f4b46ebf876d631a8dc5fae667e9fd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2023-10-10 14:20:47 +02:00
parent f723b59bfc
commit fa01c8029a
2 changed files with 2 additions and 4 deletions

View File

@@ -364,9 +364,7 @@ void CppSourceProcessor::mergeEnvironment(Document::Ptr doc)
if (!doc)
return;
const QString fn = doc->filePath().path();
if (!Utils::insert(m_processed, fn))
if (!Utils::insert(m_processed, doc->filePath()))
return;
const QList<Document::Include> includes = doc->resolvedIncludes();

View File

@@ -96,7 +96,7 @@ private:
QSet<Utils::FilePath> m_included;
CPlusPlus::Document::Ptr m_currentDoc;
QSet<QString> m_todo;
QSet<QString> m_processed;
QSet<Utils::FilePath> m_processed;
QHash<Utils::FilePath, Utils::FilePath> m_fileNameCache;
int m_fileSizeLimitInMb = -1;
QTextCodec *m_defaultCodec;