From fa01c8029aa1986ff63b4cb48993ec0ff263f714 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 10 Oct 2023 14:20:47 +0200 Subject: [PATCH] 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 --- src/plugins/cppeditor/cppsourceprocessor.cpp | 4 +--- src/plugins/cppeditor/cppsourceprocessor.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/cppeditor/cppsourceprocessor.cpp b/src/plugins/cppeditor/cppsourceprocessor.cpp index 1c8c79a2c2c..4cdc6962416 100644 --- a/src/plugins/cppeditor/cppsourceprocessor.cpp +++ b/src/plugins/cppeditor/cppsourceprocessor.cpp @@ -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 includes = doc->resolvedIncludes(); diff --git a/src/plugins/cppeditor/cppsourceprocessor.h b/src/plugins/cppeditor/cppsourceprocessor.h index 75ea0fa8d21..d5a2763e30d 100644 --- a/src/plugins/cppeditor/cppsourceprocessor.h +++ b/src/plugins/cppeditor/cppsourceprocessor.h @@ -96,7 +96,7 @@ private: QSet m_included; CPlusPlus::Document::Ptr m_currentDoc; QSet m_todo; - QSet m_processed; + QSet m_processed; QHash m_fileNameCache; int m_fileSizeLimitInMb = -1; QTextCodec *m_defaultCodec;