diff options
author | hjk <hjk@qt.io> | 2020-07-31 14:11:46 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-07-31 13:16:40 +0000 |
commit | 78406916a3e4413f5e0d87d2e3d6250d9d186efa (patch) | |
tree | 1afc0cdc6c39be9b810a56668e2d4d92d45bf004 /src/plugins/debugger/qml | |
parent | 4bbf76a344bf1ce84297bb16ab15f23ea4f18378 (diff) | |
download | qt-creator-78406916a3e4413f5e0d87d2e3d6250d9d186efa.tar.gz |
Debugger: Avoid use of QHash::values(...) in QmlEngine
This will be gone in Qt6 and seems unnecessary here as insertion
into the hash explicitly checks containment first, so this was
effectively not used as QMultiHash anyway.
Change-Id: I3f6ef9473930f72ee9b5f81f3623829d63619cc0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/debugger/qml')
-rw-r--r-- | src/plugins/debugger/qml/qmlengine.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index a94e398263..a3d2fa9098 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -2383,23 +2383,22 @@ void QmlEnginePrivate::handleLookup(const QVariantMap &response) for (const QString &handleString : handlesList) { const int handle = handleString.toInt(); const QmlV8ObjectData bodyObjectData = extractData(body.value(handleString)); - const QList<LookupData> vals = currentlyLookingUp.values(handle); + const LookupData res = currentlyLookingUp.value(handle); currentlyLookingUp.remove(handle); - for (const LookupData &res : vals) { - auto item = new WatchItem; - item->exp = res.exp; - item->iname = res.iname; - item->name = res.name; - item->id = handle; - item->type = bodyObjectData.type; - item->value = bodyObjectData.value.toString(); + auto item = new WatchItem; + item->exp = res.exp; + item->iname = res.iname; + item->name = res.name; + item->id = handle; - setWatchItemHasChildren(item, bodyObjectData.hasChildren()); - insertSubItems(item, bodyObjectData.properties); + item->type = bodyObjectData.type; + item->value = bodyObjectData.value.toString(); - engine->watchHandler()->insertItem(item); - } + setWatchItemHasChildren(item, bodyObjectData.hasChildren()); + insertSubItems(item, bodyObjectData.properties); + + engine->watchHandler()->insertItem(item); } checkForFinishedUpdate(); } |