summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-09-07 15:11:36 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-09 21:05:55 +0200
commit8fca1e70e7a8b1dc21a0134b6786e84faff91823 (patch)
tree8d538effeb221a0d59c06b416ef2fdef1dd1f9b0 /src/tools/moc
parent6998c4b2ad5fdf5f525bd77ec0fd3c6667b102b7 (diff)
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>
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/symbols.h13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/tools/moc/symbols.h b/src/tools/moc/symbols.h
index eadb2db875..a53cc1802e 100644
--- a/src/tools/moc/symbols.h
+++ b/src/tools/moc/symbols.h
@@ -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));
}