aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmljs
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-08-11 13:08:00 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-08-20 06:52:34 +0000
commit3ef4fac9ff3f785d3ccbda4b28ec2c0ea2ee1b59 (patch)
tree2f832329d0b76f3b524470af0f97b3bba45ff8d1 /tools/qmljs
parentc754b71eb4a141536dfb3e6697fbd089f4cba8e9 (diff)
tools: replace 'foreach' with 'range for'
Mark some local variables or parameters as const to prevent detach()'ing. Use qAsConst where is not possible mark as const. Change-Id: I0a777c3bd855abd3bb1ad0907152360cf4a1050e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tools/qmljs')
-rw-r--r--tools/qmljs/qmljs.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/qmljs/qmljs.cpp b/tools/qmljs/qmljs.cpp
index 4f79546bcc..964afc265b 100644
--- a/tools/qmljs/qmljs.cpp
+++ b/tools/qmljs/qmljs.cpp
@@ -118,7 +118,7 @@ static void showException(QV4::ExecutionContext *ctx, const QV4::Value &exceptio
std::cerr << "Uncaught exception: " << qPrintable(message->toQStringNoThrow()) << std::endl;
}
- foreach (const QV4::StackFrame &frame, trace) {
+ for (const QV4::StackFrame &frame : trace) {
std::cerr << " at " << qPrintable(frame.function) << " (" << qPrintable(frame.source);
if (frame.line >= 0)
std::cerr << ':' << frame.line;
@@ -188,7 +188,7 @@ int main(int argc, char *argv[])
QV4::ScopedObject gc(scope, vm.memoryManager->allocObject<builtins::GC>(ctx));
vm.globalObject->put(QV4::ScopedString(scope, vm.newIdentifier(QStringLiteral("gc"))).getPointer(), gc);
- foreach (const QString &fn, args) {
+ for (const QString &fn : qAsConst(args)) {
QFile file(fn);
if (file.open(QFile::ReadOnly)) {
const QString code = QString::fromUtf8(file.readAll());