From 58ec01e278496bdaaee05546beb543a119de4277 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 2 Jul 2012 09:01:56 +0100 Subject: More qHash(T, uint) support Add the seed to QPair, QUuid, QPersistentModelIndex's qHash(), and fix qHash documentation for them and for many other datatypes. Change-Id: I1386f3ed42ee1a832371a242ee5c82895ba92c2b Reviewed-by: Thiago Macieira --- src/corelib/tools/qhash.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/tools/qhash.h') diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 8f01cd2d91..0c322cddcf 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -103,11 +103,11 @@ template inline uint qHash(const T *key, uint seed = 0) #pragma warning( pop ) #endif -template inline uint qHash(const QPair &key) +template inline uint qHash(const QPair &key, uint seed = 0) { - uint h1 = qHash(key.first); - uint h2 = qHash(key.second); - return ((h1 << 16) | (h1 >> 16)) ^ h2; + uint h1 = qHash(key.first, seed); + uint h2 = qHash(key.second, seed); + return ((h1 << 16) | (h1 >> 16)) ^ h2 ^ seed; } template inline uint qHash(const T &t, uint seed) { return (qHash(t) ^ seed); } -- cgit v1.2.3