GLSLEditor: Replace foreach with range-based for loops

Change-Id: Ie28411ec0f69a4cee0feff61b11ed73a897174ea
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-11-23 22:33:59 +01:00
parent 6a20c52cc9
commit 68116ae4f1
3 changed files with 4 additions and 4 deletions

View File

@@ -164,7 +164,6 @@ const ArrayType *Engine::arrayType(const Type *elementType)
return _arrayTypes.intern(ArrayType(elementType));
}
QList<DiagnosticMessage> Engine::diagnosticMessages() const
{
return _diagnosticMessages;

View File

@@ -45,7 +45,7 @@ Document::~Document()
GLSL::Scope *Document::scopeAt(int position) const
{
foreach (const Range &c, _cursors) {
for (const Range &c : _cursors) {
if (position >= c.cursor.selectionStart() && position <= c.cursor.selectionEnd())
return c.scope;
}
@@ -445,7 +445,7 @@ IAssistProposal *GlslCompletionAssistProcessor::performAsync()
// m_completions += m_keywordCompletions;
}
foreach (GLSL::Symbol *s, members) {
for (GLSL::Symbol *s : std::as_const(members)) {
QIcon icon;
GLSL::Variable *var = s->asVariable();
if (var) {

View File

@@ -264,7 +264,8 @@ void GlslEditorWidget::updateDocumentNow()
QList<QTextEdit::ExtraSelection> sels;
QSet<int> errors;
foreach (const DiagnosticMessage &m, doc->_engine->diagnosticMessages()) {
const QList<DiagnosticMessage> messages = doc->_engine->diagnosticMessages();
for (const DiagnosticMessage &m : messages) {
if (! m.line())
continue;
else if (errors.contains(m.line()))