From 1e8294ecc431c4d554315c89ad050a03aefbb507 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Thu, 8 Sep 2016 16:18:31 +0300 Subject: Qml compiler: replace 'foreach' with 'range for' ... and with 'index-based for' in one place. Change-Id: I4df75bd5921f9ee8b5744067adbaafbc46452f87 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml/compiler/qv4compiler.cpp') diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index c6a872cc34..0f39506c28 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -211,7 +211,7 @@ int QV4::Compiler::JSUnitGenerator::registerJSClass(int count, IR::ExprList *arg QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(GeneratorOption option) { registerString(irModule->fileName); - foreach (QV4::IR::Function *f, irModule->functions) { + for (QV4::IR::Function *f : qAsConst(irModule->functions)) { registerString(*f->name); for (int i = 0; i < f->formals.size(); ++i) registerString(*f->formals.at(i)); @@ -242,7 +242,7 @@ QV4::CompiledData::Unit *QV4::Compiler::JSUnitGenerator::generateUnit(GeneratorO } CompiledData::Lookup *lookupsToWrite = reinterpret_cast(dataPtr + unit->offsetToLookupTable); - foreach (const CompiledData::Lookup &l, lookups) + for (const CompiledData::Lookup &l : qAsConst(lookups)) *lookupsToWrite++ = l; CompiledData::RegExp *regexpTable = reinterpret_cast(dataPtr + unit->offsetToRegexpTable); -- cgit v1.2.3