diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2025-03-13 08:30:06 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2025-05-09 16:54:13 -0700 |
| commit | c05ae82efb33507959ae2082483fb9425ccca8a0 (patch) | |
| tree | de0398da78fee891aaf5f9bbf2ce1299c3e5aeba /src/corelib/serialization/qjsonobject.cpp | |
| parent | b10c7b1680d57174f2b4d5a08387378550434ae9 (diff) | |
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 <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/serialization/qjsonobject.cpp')
| -rw-r--r-- | src/corelib/serialization/qjsonobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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(); |
