diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-08-02 23:02:08 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-04 09:16:06 +0000 |
commit | 60eab28305e7b51fe8efcb828628001674919408 (patch) | |
tree | 88179fc79d4a5f9461115ede41671126ec4ffc54 /src/plugins | |
parent | ab3d0c0ace581500797ec1d4c0b9042ddfe64df3 (diff) |
Simplify ObjectIterator::next
Use PropertyKey instead of two out pointers
Change-Id: I4f57bcb36fd412f19f0ed116042f7b094b5785dc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp | 10 | ||||
-rw-r--r-- | src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp | 15 |
2 files changed, 10 insertions, 15 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp index 876bb6bb60..5bfeca13e3 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp @@ -154,15 +154,13 @@ const QV4::Object *collectProperty(const QV4::ScopedValue &value, QV4::Execution int numProperties = 0; QV4::ObjectIterator it(scope, o, QV4::ObjectIterator::EnumerableOnly); QV4::PropertyAttributes attrs; - uint index; QV4::ScopedProperty p(scope); - QV4::ScopedString name(scope); + QV4::ScopedPropertyKey name(scope); while (true) { - it.next(name.getRef(), &index, p, &attrs); - if (attrs.isEmpty()) + name = it.next(p, &attrs); + if (!name->isValid()) break; - else - ++numProperties; + ++numProperties; } dict.insert(valueKey, numProperties); return o; diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp index b98cfffb6e..3b47f73949 100644 --- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp +++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp @@ -427,20 +427,17 @@ void Collector::collect(QJsonArray *out, const QString &parentIName, const QStri qint64 numProperties = 0; QV4::ObjectIterator it(scope, object, QV4::ObjectIterator::EnumerableOnly); QV4::ScopedProperty p(scope); - QV4::ScopedString name(scope); + QV4::ScopedPropertyKey name(scope); while (true) { QV4::PropertyAttributes attrs; - uint index; - it.next(name.getRef(), &index, p, &attrs); - if (attrs.isEmpty()) + name = it.next(p, &attrs); + if (!name->isValid()) break; - if (name.getPointer()) { + if (name->isStringOrSymbol()) { ++numProperties; if (expanded) { - if (name.getPointer()) { - QV4::Value v = p.property->value; - collect(&children, iname, name->toQStringNoThrow(), v); - } + QV4::Value v = p.property->value; + collect(&children, iname, name->toQString(), v); } } } |