qmljs: Remove foreach usage

Task-number: QTCREATORBUG-27464
Change-Id: Ifdb8cf514dfe328e0a64bde1beff3e63a4b7fbc3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Artem Sokolovskii
2022-12-19 16:41:00 +01:00
parent 50ebf1f824
commit f0556b08b8
26 changed files with 138 additions and 125 deletions

View File

@@ -48,7 +48,7 @@ void ScopeBuilder::push(AST::Node *node)
const ObjectValue *owner = nullptr;
const Value *value = nullptr;
// try to find the name on the scope objects
foreach (const ObjectValue *scope, _scopeChain->qmlScopeObjects()) {
for (const ObjectValue *scope : _scopeChain->qmlScopeObjects()) {
value = scope->lookupMember(name, _scopeChain->context(), &owner);
if (value)
break;
@@ -84,7 +84,7 @@ void ScopeBuilder::push(AST::Node *node)
void ScopeBuilder::push(const QList<AST::Node *> &nodes)
{
foreach (Node *node, nodes)
for (Node *node : nodes)
push(node);
}
@@ -196,7 +196,7 @@ const Value *ScopeBuilder::scopeObjectLookup(AST::UiQualifiedId *id)
{
// do a name lookup on the scope objects
const Value *result = nullptr;
foreach (const ObjectValue *scopeObject, _scopeChain->qmlScopeObjects()) {
for (const ObjectValue *scopeObject : _scopeChain->qmlScopeObjects()) {
const ObjectValue *object = scopeObject;
for (UiQualifiedId *it = id; it; it = it->next) {
if (it->name.isEmpty())