moc: make qHash(SubArray) accept a seed

This prevents the use of the one-arg-to-two-arg adapter template which
we'd remove rather sooner than later, because it's causing all sorts of
problems, but probably can't, until Qt 7.

Task-number: QTBUG-116074
Change-Id: I5907da0dc8c01b636d16dcc01e9c808ab9a85081
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 5c8910adfd613382e97c5517e85e9088a2abbe3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-09-12 15:50:01 +02:00 committed by Qt Cherry-pick Bot
parent 5a6d960018
commit 183f179fd0

View File

@ -7,7 +7,7 @@
#include "token.h"
#include <qdebug.h>
#include <qhash.h>
#include <qhashfunctions.h>
#include <qlist.h>
#include <qstack.h>
#include <qstring.h>
@ -39,9 +39,9 @@ struct SubArray
}
};
inline size_t qHash(const SubArray &key)
inline size_t qHash(const SubArray &key, size_t seed = 0)
{
return qHash(QLatin1StringView(key.array.constData() + key.from, key.len));
return qHash(QLatin1StringView(key.array.constData() + key.from, key.len), seed);
}