diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-04-21 07:43:42 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-06-15 23:25:00 +0000 |
commit | bc144312c18e7436275267ad8900fce980597c45 (patch) | |
tree | a6a46e5b9d60d1b51577cc9dae2a256fa3c2662c /src/corelib/compat/removed_api.cpp | |
parent | 2a1122f46587e27f3d93e1f2af63f439116569c4 (diff) |
qHash: pass QByteArrayView to qHash() by value
The QBAV one should pass the parameter by value, like QStringView. And
now that we have it, the non-View one should call the View one in an
inline function, like we already do for QString.
The extra, defaulted parameter is there only so we get a different
signature in the new inline function compared to the removed one.
Pick-to: 6.4
Change-Id: If05aeeb7176e4f13af9afffd16e7f08062b1dc86
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/compat/removed_api.cpp')
-rw-r--r-- | src/corelib/compat/removed_api.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index 7c3dbd3be2..2b00142954 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -170,6 +170,18 @@ QCalendar::QCalendar(QLatin1StringView name) : QCalendar(QAnyStringView{name}) {} +#include "qhashfunctions.h" + +size_t qHash(const QByteArray &key, size_t seed) noexcept +{ + return qHashBits(key.constData(), size_t(key.size()), seed); +} + +size_t qHash(const QByteArrayView &key, size_t seed) noexcept +{ + return qHashBits(key.constData(), size_t(key.size()), seed); +} + #include "qobject.h" void QObject::setObjectName(const QString &name) |