summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cpprefactoringchanges.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-05-02 17:55:44 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2023-05-03 09:50:53 +0000
commita03bea81c7bb994367855ab40b9d76e974bbff50 (patch)
tree2a8484d47a6d1f148855971086df91a7366b20c5 /src/plugins/cppeditor/cpprefactoringchanges.cpp
parente15b38494433a6f3e608f561517966ea0d745ddf (diff)
downloadqt-creator-a03bea81c7bb994367855ab40b9d76e974bbff50.tar.gz
CppEditor: Remove WorkingCopy::contains()
Most uses involved a double look-up. Change-Id: Ifeb62ea2361222ed0faad749f44a59735c8d6930 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cpprefactoringchanges.cpp')
-rw-r--r--src/plugins/cppeditor/cpprefactoringchanges.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/cppeditor/cpprefactoringchanges.cpp b/src/plugins/cppeditor/cpprefactoringchanges.cpp
index 1cce747fc6..bb34174d06 100644
--- a/src/plugins/cppeditor/cpprefactoringchanges.cpp
+++ b/src/plugins/cppeditor/cpprefactoringchanges.cpp
@@ -57,8 +57,8 @@ CppRefactoringFilePtr CppRefactoringChanges::file(const FilePath &filePath) cons
CppRefactoringFileConstPtr CppRefactoringChanges::fileNoEditor(const FilePath &filePath) const
{
QTextDocument *document = nullptr;
- if (data()->m_workingCopy.contains(filePath))
- document = new QTextDocument(QString::fromUtf8(data()->m_workingCopy.source(filePath)));
+ if (const auto source = data()->m_workingCopy.source(filePath))
+ document = new QTextDocument(QString::fromUtf8(*source));
CppRefactoringFilePtr result(new CppRefactoringFile(document, filePath));
result->m_data = m_data;