From 55dff384c1c8361a65feed452584d40ad9e1bcb0 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 14 Feb 2020 15:27:24 +0100 Subject: Use qHashMulti in qHash(QQuickPixmapKey) Amends 9cc4568de330e0075c960a5431ecd69a1f9a761d (and others). Change-Id: Ic67a34ffb903d79882d4a74415f52db5a79d30d6 Reviewed-by: Volker Hilsheimer --- src/quick/util/qquickpixmapcache.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/quick/util') diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 891e3836b0..bc5890a54a 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -1028,13 +1028,9 @@ inline bool operator==(const QQuickPixmapKey &lhs, const QQuickPixmapKey &rhs) lhs.options == rhs.options; } -inline size_t qHash(const QQuickPixmapKey &key) +inline size_t qHash(const QQuickPixmapKey &key, size_t seed) noexcept { - return qHash(*key.url) ^ (key.size->width()*7) ^ (key.size->height()*17) ^ (key.frame*23) ^ - (key.region->x()*29) ^ (key.region->y()*31) ^ (key.options.autoTransform() * 0x5c5c5c5c); - // key.region.width() and height() are not included, because the hash function should be simple, - // and they are more likely to be held constant for some batches of images - // (e.g. tiles, or repeatedly cropping to the same viewport at different positions). + return qHashMulti(seed, *key.url, *key.region, *key.size, key.frame, key.options.autoTransform()); } class QQuickPixmapStore : public QObject -- cgit v1.2.3