summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-03-12 12:31:07 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-05-05 02:31:54 +0200
commit2c9a29a09ad90b3707b9eab6aca7bffd3fc9413d (patch)
treef458554c9159bce2db4cc0934d9e95a45e54d924 /src
parent317383217baa280b7e7401a5adc4ce976320e272 (diff)
QHashFunctions: port to if constexpr
Condition is a compile-time one. Change-Id: I6e60f12cc51e96b2528c375017357c0631e2fc0b Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qhashfunctions.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h
index ef83682433..e52688b88d 100644
--- a/src/corelib/tools/qhashfunctions.h
+++ b/src/corelib/tools/qhashfunctions.h
@@ -115,7 +115,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline size_t qHash(long key, size_t seed
{ return QHashPrivate::hash(size_t(key), seed); }
Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline size_t qHash(quint64 key, size_t seed = 0) noexcept
{
- if (sizeof(quint64) > sizeof(size_t))
+ if constexpr (sizeof(quint64) > sizeof(size_t))
key ^= (key >> 32);
return QHashPrivate::hash(size_t(key), seed);
}