From bc144312c18e7436275267ad8900fce980597c45 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 21 Apr 2022 07:43:42 -0700 Subject: 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 --- src/corelib/compat/removed_api.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/corelib/compat/removed_api.cpp') 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) -- cgit v1.2.3