Moc still used a different and quite a bit more complicated
algorithm to hash 8bit strings then QByteArray.
Change-Id: I86efb08d5ab7de1863fc168dcfc73399e72e1331
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
inline uint qHash(const SubArray &key)
{
- const uchar *p = reinterpret_cast<const uchar *>(key.array.data() + key.from);
- int n = key.len;
- uint h = 0;
- uint g;
-
- while (n--) {
- h = (h << 4) + *p++;
- if ((g = (h & 0xf0000000)) != 0)
- h ^= g >> 23;
- h &= ~g;
- }
- return h;
+ return qHash(QLatin1String(key.array.constData() + key.from, key.len));
}