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>
This commit is contained in:
parent
4677cf3d01
commit
3a27d4b480
@ -73,7 +73,7 @@ struct FixStringCacheKey
|
|||||||
}
|
}
|
||||||
inline uint hashCode() const {
|
inline uint hashCode() const {
|
||||||
if(!hash)
|
if(!hash)
|
||||||
hash = qHash(string) | qHash(flags) /*| qHash(pwd)*/;
|
hash = qHash(string) ^ qHash(flags) /*^ qHash(pwd)*/;
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -98,7 +98,7 @@ struct FileInfoCacheKey
|
|||||||
}
|
}
|
||||||
inline uint hashCode() const {
|
inline uint hashCode() const {
|
||||||
if(!hash)
|
if(!hash)
|
||||||
hash = qHash(file) /*| qHash(pwd)*/;
|
hash = qHash(file) /*^ qHash(pwd)*/;
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
inline bool isRelativePath(const QString &file) {
|
inline bool isRelativePath(const QString &file) {
|
||||||
|
@ -68,7 +68,7 @@ struct ReplaceExtraCompilerCacheKey
|
|||||||
bool operator==(const ReplaceExtraCompilerCacheKey &f) const;
|
bool operator==(const ReplaceExtraCompilerCacheKey &f) const;
|
||||||
inline uint hashCode() const {
|
inline uint hashCode() const {
|
||||||
if(!hash)
|
if(!hash)
|
||||||
hash = qHash(var) | qHash(in) | qHash(out) /*| qHash(pwd)*/;
|
hash = qHash(var) ^ qHash(in) ^ qHash(out) /*^ qHash(pwd)*/;
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user