From c05ae82efb33507959ae2082483fb9425ccca8a0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 13 Mar 2025 08:30:06 -0700 Subject: qHashMulti: switch to passing the seed to the qHash() function in 7.0 Amends 707129fd5a7c6390fbdf4270119226df2a427fcd. This is much better for our string types because qHashBits() has a faster implementation when seed!=0. The algorithm is the same, except that QHashCombine now separates the seed from the combined hash, not merging the two unrelated concepts together. We can't fix it in Qt 6.x because it changes the hashing algorithm of existing types that used qHashMulti(), which will have been inlined throughout user code. The deprecated constructor is there only until the rest of Qt is fixed. Since this is a private class, that won't stay for long. Task-number: QTBUG-134683 Fixes: QTBUG-134690 Change-Id: I2167e154f083089d12a1fffd61c1ab8670731156 Reviewed-by: Edward Welbourne --- src/corelib/serialization/qjsonobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/serialization/qjsonobject.cpp') diff --git a/src/corelib/serialization/qjsonobject.cpp b/src/corelib/serialization/qjsonobject.cpp index 99f5507aa12..3e0857dc954 100644 --- a/src/corelib/serialization/qjsonobject.cpp +++ b/src/corelib/serialization/qjsonobject.cpp @@ -1445,7 +1445,7 @@ void QJsonObject::removeAt(qsizetype index) size_t qHash(const QJsonObject &object, size_t seed) { - QtPrivate::QHashCombine hash; + QtPrivate::QHashCombine hash(seed); for (auto it = object.begin(), end = object.end(); it != end; ++it) { const QString key = it.key(); const QJsonValue value = it.value(); -- cgit v1.2.3