diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-02-08 09:03:08 +0100 |
---|---|---|
committer | Holger Freyther <holger+qt@freyther.de> | 2015-02-18 07:40:49 +0000 |
commit | 3fcb6ccac0baa34b820534184f863884e072cfb2 (patch) | |
tree | 601f23d7c2f961caa51d386ea2c67e5eb55ef233 /src/qml/qml | |
parent | 20c207815a0c942e1f66966cbeedcb0cd332e3b5 (diff) |
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<NamedNodeMap>()" 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 <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlxmlhttprequest.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
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<NamedNodeMap>(); + Q_ASSERT(m->as<NamedNodeMap>()); + NamedNodeMap *r = static_cast<NamedNodeMap *>(m); QV4::ExecutionEngine *v4 = r->engine(); - if (!r) { - if (hasProperty) - *hasProperty = false; - return v4->throwTypeError(); - } if ((int)index < r->d()->list.count()) { if (hasProperty) |