summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qhash.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-02-20 07:42:16 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-02-20 07:42:16 (GMT)
commitf0eb658611f549470f0d90e141eda61ab9301838 (patch)
treee234b73e10490e297033d645b744a7cbd26da4b9 /src/corelib/tools/qhash.cpp
parentba9c21f7a1398ddcdeee6f010b1477d79f5bb8ce (diff)
parent8f10ca802dee1ed110f301191c4a56a85575033c (diff)
downloadQt-f0eb658611f549470f0d90e141eda61ab9301838.zip
Qt-f0eb658611f549470f0d90e141eda61ab9301838.tar.gz
Qt-f0eb658611f549470f0d90e141eda61ab9301838.tar.bz2
Merge remote branch 'origin/master'
Conflicts: doc/src/declarative/advtutorial1.qdoc
Diffstat (limited to 'src/corelib/tools/qhash.cpp')
-rw-r--r--src/corelib/tools/qhash.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 285f4c9..85a8b63 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -64,13 +64,11 @@ QT_BEGIN_NAMESPACE
static uint hash(const uchar *p, int n)
{
uint h = 0;
- uint g;
while (n--) {
h = (h << 4) + *p++;
- g = h & 0xf0000000;
- h ^= g >> 23;
- h &= ~g;
+ h ^= (h & 0xf0000000) >> 23;
+ h &= 0x0fffffff;
}
return h;
}
@@ -78,13 +76,11 @@ static uint hash(const uchar *p, int n)
static uint hash(const QChar *p, int n)
{
uint h = 0;
- uint g;
while (n--) {
h = (h << 4) + (*p++).unicode();
- g = h & 0xf0000000;
- h ^= g >> 23;
- h &= ~g;
+ h ^= (h & 0xf0000000) >> 23;
+ h &= 0x0fffffff;
}
return h;
}