Use the same hash for 8 bit strings as in QByteArray
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>
This commit is contained in:
parent
6998c4b2ad
commit
8fca1e70e7
@ -72,18 +72,7 @@ struct SubArray
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user