diff options
author | Rafael Roquetto <rafael.roquetto.qnx@kdab.com> | 2012-07-24 15:45:44 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-25 13:31:05 +0200 |
commit | 3a27d4b480214072d972ac67561f2ee4010f8baa (patch) | |
tree | d528873df84c81534c73a34370b95bf13b055f25 /qmake/cachekeys.h | |
parent | 4677cf3d014d9b25c3516dd0e07a1a3fcd8af8e9 (diff) | |
download | qtbase-3a27d4b480214072d972ac67561f2ee4010f8baa.tar.gz |
Fix qmake hash function to use XOR
Use XOR instead of OR in order to avoid saturating all bits when computing the
hash value.
Change-Id: I50b1a044eb827239dae1c04732ca6a065f6233b4
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'qmake/cachekeys.h')
-rw-r--r-- | qmake/cachekeys.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qmake/cachekeys.h b/qmake/cachekeys.h index c164304f31..da3aee1b35 100644 --- a/qmake/cachekeys.h +++ b/qmake/cachekeys.h @@ -73,7 +73,7 @@ struct FixStringCacheKey } inline uint hashCode() const { if(!hash) - hash = qHash(string) | qHash(flags) /*| qHash(pwd)*/; + hash = qHash(string) ^ qHash(flags) /*^ qHash(pwd)*/; return hash; } }; @@ -98,7 +98,7 @@ struct FileInfoCacheKey } inline uint hashCode() const { if(!hash) - hash = qHash(file) /*| qHash(pwd)*/; + hash = qHash(file) /*^ qHash(pwd)*/; return hash; } inline bool isRelativePath(const QString &file) { |