Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.0, 6.10
-
None
-
eb1342a3c (dev), db36fea29 (6.9), 1a580ca2a (dev)
Description
The implementations of qHashMulti() and qHashMultiCommutative() are implemented using calls to qHash() without a seed parameter:
constexpr result_type operator()(size_t seed, const T &t) const noexcept(noexcept(qHash(t))) // combiner taken from N3876 / boost::hash_combine { return seed ^ (qHash(t) + 0x9e3779b9 + (seed << 6) + (seed >> 2)) ; } ... constexpr result_type operator()(size_t seed, const T &t) const noexcept(noexcept(qHash(t))) { return seed + qHash(t); } // don't use xor!
This results in using the slower implementation of qHashBits() for all of our string classes.
I don't know if qHashMultiCommutative() is fixable, but qHashMulti() definitely is.
Requires BC break to fix.
Attachments
Issue Links
- resulted from
-
QTBUG-134683 Deprecated one argument version of qHash still required in qHashMulti
-
- Closed
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-134690 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
631512,10 | qHashMulti: switch to passing the seed to the qHash() function in 7.0 | dev | qt/qtbase | Status: NEW | 0 | 0 |
631472,3 | QHash/Doc: be explicit that we need single-arg calls for qHashMulti() | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
631509,3 | qHash: break up the long line and add constexpr to the 1-arg catch-all | dev | qt/qtbase | Status: MERGED | +2 | 0 |
631510,6 | qHashMulti*: use the seed argument in the template and noexcept traits | dev | qt/qtbase | Status: MERGED | +2 | 0 |
631645,2 | qHash: break up the long line and add constexpr to the 1-arg catch-all | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |
632053,1 | qHash: break up the long line and add constexpr to the 1-arg catch-all | 6.9.0 | qt/qtbase | Status: ABANDONED | +2 | 0 |