From 2c9a29a09ad90b3707b9eab6aca7bffd3fc9413d Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 12 Mar 2020 12:31:07 +0100 Subject: [PATCH] QHashFunctions: port to if constexpr Condition is a compile-time one. Change-Id: I6e60f12cc51e96b2528c375017357c0631e2fc0b Reviewed-by: Lars Knoll Reviewed-by: Marc Mutz --- src/corelib/tools/qhashfunctions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }