mirror of
https://github.com/RPCSX/llvm.git
synced 2025-03-01 09:26:22 +00:00
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32962 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
15c91887e4
commit
38742b9603
@ -33,8 +33,11 @@ CStringMapImpl::CStringMapImpl(unsigned InitSize, unsigned itemSize) {
|
||||
/// HashString - Compute a hash code for the specified string.
|
||||
///
|
||||
static unsigned HashString(const char *Start, const char *End) {
|
||||
// Bernstein hash function.
|
||||
unsigned int Result = 0;
|
||||
// Perl hash function.
|
||||
// TODO: investigate whether a modified bernstein hash function performs
|
||||
// better: http://eternallyconfuzzled.com/tuts/hashing.html#existing
|
||||
// X*33+c -> X*33^c
|
||||
while (Start != End)
|
||||
Result = Result * 33 + *Start++;
|
||||
Result = Result + (Result >> 5);
|
||||
|
@ -33,8 +33,11 @@ CStringMapImpl::CStringMapImpl(unsigned InitSize, unsigned itemSize) {
|
||||
/// HashString - Compute a hash code for the specified string.
|
||||
///
|
||||
static unsigned HashString(const char *Start, const char *End) {
|
||||
// Bernstein hash function.
|
||||
unsigned int Result = 0;
|
||||
// Perl hash function.
|
||||
// TODO: investigate whether a modified bernstein hash function performs
|
||||
// better: http://eternallyconfuzzled.com/tuts/hashing.html#existing
|
||||
// X*33+c -> X*33^c
|
||||
while (Start != End)
|
||||
Result = Result * 33 + *Start++;
|
||||
Result = Result + (Result >> 5);
|
||||
|
Loading…
x
Reference in New Issue
Block a user