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:
@@ -302,12 +302,13 @@ void BuiltinEditorDocumentProcessor::onCodeWarningsUpdated(
|
||||
|
||||
SemanticInfo::Source BuiltinEditorDocumentProcessor::createSemanticInfoSource(bool force) const
|
||||
{
|
||||
const WorkingCopy workingCopy = CppModelManager::instance()->workingCopy();
|
||||
return SemanticInfo::Source(filePath().toString(),
|
||||
workingCopy.source(filePath()),
|
||||
workingCopy.revision(filePath()),
|
||||
m_documentSnapshot,
|
||||
force);
|
||||
QByteArray source;
|
||||
int revision = 0;
|
||||
if (const auto entry = CppModelManager::instance()->workingCopy().get(filePath())) {
|
||||
source = entry->first;
|
||||
revision = entry->second;
|
||||
}
|
||||
return SemanticInfo::Source(filePath().toString(), source, revision, m_documentSnapshot, force);
|
||||
}
|
||||
|
||||
} // namespace CppEditor
|
||||
|
||||
Reference in New Issue
Block a user