diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 87ccc46d71..af393b9235 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -1140,21 +1140,12 @@ size_t qHash(QLatin1StringView key, size_t seed) noexcept // the seed is always 0 in bootstrapped mode (no seed generation code), // so help the compiler do dead code elimination seed = 0; - constexpr bool Qt6DeterministicHash = true; -#else - constexpr bool Qt6DeterministicHash = QT_VERSION_MAJOR == 6; #endif auto data = reinterpret_cast(key.data()); size_t size = key.size(); - if (seed == 0 && Qt6DeterministicHash) { - // fall back to what we used to use prior to Qt 6.8 - return qHashBits(data, size, seed); - } - - // mix in the length as a secondary seed. For seed == 0, seed2 must be - // size, to match what we used to do prior to Qt 6.2. + // Mix in the length as a secondary seed. // Multiplied by 2 to match the byte size of the equiavlent UTF-16 string. size_t seed2 = size * 2; if (seed) diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h index 9056d24102..90a269deaa 100644 --- a/src/corelib/tools/qhashfunctions.h +++ b/src/corelib/tools/qhashfunctions.h @@ -58,6 +58,12 @@ template <> struct QHashHeterogeneousSearch : std::true_ty template <> struct QHashHeterogeneousSearch : std::true_type {}; template <> struct QHashHeterogeneousSearch : std::true_type {}; template <> struct QHashHeterogeneousSearch : std::true_type {}; +#ifndef Q_PROCESSOR_ARM +template <> struct QHashHeterogeneousSearch : std::true_type {}; +template <> struct QHashHeterogeneousSearch : std::true_type {}; +template <> struct QHashHeterogeneousSearch : std::true_type {}; +template <> struct QHashHeterogeneousSearch : std::true_type {}; +#endif namespace QHashPrivate { diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp index 06f18dfe9c..00ee5763ed 100644 --- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp +++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp @@ -324,7 +324,7 @@ void tst_QHashFunctions::stringConsistency() QCOMPARE(qHash(sv, seed), qHash(value, seed)); QCOMPARE(qHash(u8bav, seed), qHash(u8ba, seed)); - if (seed || QT_VERSION_MAJOR > 6) { + if (seed == 0 || QHashHeterogeneousSearch::value) { QByteArray l1ba = value.toLatin1(); QLatin1StringView l1sv(l1ba.data(), l1ba.size()); #ifdef Q_PROCESSOR_ARM