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:
@@ -43,8 +43,8 @@ bool CppParser::selectedForBuilding(const FilePath &fileName)
|
||||
QByteArray CppParser::getFileContent(const FilePath &filePath) const
|
||||
{
|
||||
QByteArray fileContent;
|
||||
if (m_workingCopy.contains(filePath)) {
|
||||
fileContent = m_workingCopy.source(filePath);
|
||||
if (const auto source = m_workingCopy.source(filePath)) {
|
||||
fileContent = *source;
|
||||
} else {
|
||||
QString error;
|
||||
const QTextCodec *codec = Core::EditorManager::defaultTextCodec();
|
||||
|
||||
Reference in New Issue
Block a user