forked from qt-creator/qt-creator
GLSLEditor: Replace foreach with range-based for loops
Change-Id: Ie28411ec0f69a4cee0feff61b11ed73a897174ea Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -164,7 +164,6 @@ const ArrayType *Engine::arrayType(const Type *elementType)
|
||||
return _arrayTypes.intern(ArrayType(elementType));
|
||||
}
|
||||
|
||||
|
||||
QList<DiagnosticMessage> Engine::diagnosticMessages() const
|
||||
{
|
||||
return _diagnosticMessages;
|
||||
|
@@ -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) {
|
||||
|
@@ -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()))
|
||||
|
Reference in New Issue
Block a user