From 56cf625ad3cf86c4417acf463c4bfb369c7f0916 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 13 Oct 2016 10:57:54 +0200 Subject: QQuickItem: eliminate repeated access to QQmlV4Function::v4engine() Change-Id: Ifc33c17d125ca794a157a87dc5cc1be51c2aaefb Reviewed-by: Simon Hausmann --- src/quick/items/qquickitem.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index fe4d84b334..f371138ea3 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -4363,12 +4363,12 @@ void QQuickItem::polish() */ void QQuickItem::mapFromItem(QQmlV4Function *args) const { + QV4::ExecutionEngine *v4 = args->v4engine(); if (args->length() != 3 && args->length() != 5) { - args->v4engine()->throwTypeError(); + v4->throwTypeError(); return; } - QV4::ExecutionEngine *v4 = args->v4engine(); QV4::Scope scope(v4); QV4::ScopedValue item(scope, (*args)[0]); @@ -4382,7 +4382,7 @@ void QQuickItem::mapFromItem(QQmlV4Function *args) const if (!itemObj && !item->isNull()) { qmlInfo(this) << "mapFromItem() given argument \"" << item->toQStringNoThrow() << "\" which is neither null nor an Item"; - args->v4engine()->throwTypeError(); + v4->throwTypeError(); return; } @@ -4390,7 +4390,7 @@ void QQuickItem::mapFromItem(QQmlV4Function *args) const QV4::ScopedValue vy(scope, (*args)[2]); if (!vx->isNumber() || !vy->isNumber()) { - args->v4engine()->throwTypeError(); + v4->throwTypeError(); return; } @@ -4403,7 +4403,7 @@ void QQuickItem::mapFromItem(QQmlV4Function *args) const QV4::ScopedValue vw(scope, (*args)[3]); QV4::ScopedValue vh(scope, (*args)[4]); if (!vw->isNumber() || !vh->isNumber()) { - args->v4engine()->throwTypeError(); + v4->throwTypeError(); return; } qreal w = vw->asDouble(); @@ -4451,12 +4451,12 @@ QTransform QQuickItem::itemTransform(QQuickItem *other, bool *ok) const */ void QQuickItem::mapToItem(QQmlV4Function *args) const { + QV4::ExecutionEngine *v4 = args->v4engine(); if (args->length() != 3 && args->length() != 5) { - args->v4engine()->throwTypeError(); + v4->throwTypeError(); return; } - QV4::ExecutionEngine *v4 = args->v4engine(); QV4::Scope scope(v4); QV4::ScopedValue item(scope, (*args)[0]); @@ -4470,7 +4470,7 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const if (!itemObj && !item->isNull()) { qmlInfo(this) << "mapToItem() given argument \"" << item->toQStringNoThrow() << "\" which is neither null nor an Item"; - args->v4engine()->throwTypeError(); + v4->throwTypeError(); return; } @@ -4478,7 +4478,7 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const QV4::ScopedValue vy(scope, (*args)[2]); if (!vx->isNumber() || !vy->isNumber()) { - args->v4engine()->throwTypeError(); + v4->throwTypeError(); return; } @@ -4491,7 +4491,7 @@ void QQuickItem::mapToItem(QQmlV4Function *args) const QV4::ScopedValue vw(scope, (*args)[3]); QV4::ScopedValue vh(scope, (*args)[4]); if (!vw->isNumber() || !vh->isNumber()) { - args->v4engine()->throwTypeError(); + v4->throwTypeError(); return; } qreal w = vw->asDouble(); -- cgit v1.2.3