diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-03-15 08:39:51 +0100 |
---|---|---|
committer | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2021-12-17 17:37:49 +0100 |
commit | 9c9cdbedf173e3e5f73205826deb97337f182a3e (patch) | |
tree | ad03a5321b8bf97ff80b4e7eaa3cf6853e9333ab /src/corelib/tools/qcache.h | |
parent | 340b2a1a47244cba064c17b69782236c0d7e16e5 (diff) |
QHash: Add and use a Bucket helper class
Introduces a QHashPrivate::Data::Bucket class. This class
helps avoid repeated bitshift and masking operations when
locating bucket entries in the hash.
Change signature of some internal methods to use Bucket
instead of the private iterator, so we can avoid repeated
encoding/decoding steps for the bucket index.
Task-number: QTBUG-91739
Task-number: QTBUG-98436
Change-Id: I9ed2205bf886f9c20a5be109fd88456eec4d1540
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qcache.h')
-rw-r--r-- | src/corelib/tools/qcache.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qcache.h b/src/corelib/tools/qcache.h index 9ec99c5636..f3b3f0b677 100644 --- a/src/corelib/tools/qcache.h +++ b/src/corelib/tools/qcache.h @@ -138,7 +138,7 @@ class QCache n->prev->next = n->next; n->next->prev = n->prev; total -= n->value.cost; - auto it = d.find(n->key); + auto it = d.findBucket(n->key); d.erase(it); } T *relink(const Key &key) const noexcept |