forked from qt-creator/qt-creator
CppEditor: Remove WorkingCopy::contains()
Most uses involved a double look-up. Change-Id: Ifeb62ea2361222ed0faad749f44a59735c8d6930 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user