From 3fcb6ccac0baa34b820534184f863884e072cfb2 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 8 Feb 2015 09:03:08 +0100 Subject: NamedNodeMap: Remove logically dead code The code has been changed by Lars in the git commit 47fbcb47771a36ab9fd0a4d5ede7b7504ab1410d. Now "r->engine()" is called before the "if (!r)" check is being executed. We can assume that "m->as()" will always return a non nullptr and this allows us to remove the extra null check. Fixes CID: 86703 Change-Id: Ib4f1103e38c7e1e8e5175d91e795d2621e3a79c4 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlxmlhttprequest.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/qml/qml/qqmlxmlhttprequest.cpp') diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index c70129775c..afa79ee6b1 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -872,13 +872,9 @@ bool Node::isNull() const ReturnedValue NamedNodeMap::getIndexed(Managed *m, uint index, bool *hasProperty) { - NamedNodeMap *r = m->as(); + Q_ASSERT(m->as()); + NamedNodeMap *r = static_cast(m); QV4::ExecutionEngine *v4 = r->engine(); - if (!r) { - if (hasProperty) - *hasProperty = false; - return v4->throwTypeError(); - } if ((int)index < r->d()->list.count()) { if (hasProperty) -- cgit v1.2.3