summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-06 23:19:38 +0000
committerChris Lattner <sabre@nondot.org>2007-01-06 23:19:38 +0000
commit8a7183b5b864e81b4a3781b18041e9741d4227fb (patch)
tree86a716a7d3c1c39a542352dc1a497dece9b86f46 /llvm/lib/Support
parent72a56fc44c156ab78142204d8eeea463098b1f2a (diff)
downloadbcm5719-llvm-8a7183b5b864e81b4a3781b18041e9741d4227fb.tar.gz
bcm5719-llvm-8a7183b5b864e81b4a3781b18041e9741d4227fb.zip
add a note
llvm-svn: 32962
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/CStringMap.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Support/CStringMap.cpp b/llvm/lib/Support/CStringMap.cpp
index 3229bfe50d8..6cd3745946c 100644
--- a/llvm/lib/Support/CStringMap.cpp
+++ b/llvm/lib/Support/CStringMap.cpp
@@ -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);
OpenPOWER on IntegriCloud