diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2020-05-09 16:36:08 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-05-10 12:48:23 +0200 |
commit | f490ac671267438d8a539f4639c9e987861924cf (patch) | |
tree | d4d108eaf6f614d701b589519e69faab20fa21ed /src/corelib/serialization/qcborstreamwriter.cpp | |
parent | 8ed88d8d14ae9aed41029afe8bf4a6c42678c6b5 (diff) |
QXmlStreamReader: avoid double QHash lookups
Replace
if (hash.contains(x)) { // lookup #1
~~~ hash[x]; // lookup #2
with
if (auto it = hash.find(x); it != hash.end()) { // lookup
~~~ *it; // no lookup
halving the number of QHash lookups. The container is not shared, so
there's no danger of a detach when going directly to the non-const
function.
Change-Id: Ifae409f98e0be972b31a24326ad548723831fda8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/serialization/qcborstreamwriter.cpp')
0 files changed, 0 insertions, 0 deletions