summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-19 08:32:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-19 08:32:41 +0000
commit42d9223a2db7da93cf2f937b75b9ae287f6c7a0d (patch)
tree82917eb59288f76091aa6c57c6533e82eb7961f8
parent4e6ad7d910a27b9bddc9e3616464885184875ab4 (diff)
* string.c (hash): defaulted to MurmurHash 2.0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--string.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e94330d20bb..088887d5021 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Jan 19 17:33:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (hash): defaulted to MurmurHash 2.0.
+
Mon Jan 19 17:29:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/defines.h (RUBY_ALIAS_FUNCTION_TYPE): added.
diff --git a/string.c b/string.c
index 5540097496d..f6027df0763 100644
--- a/string.c
+++ b/string.c
@@ -1883,7 +1883,7 @@ rb_str_concat(VALUE str1, VALUE str2)
/* MurmurHash described in http://murmurhash.googlepages.com/ */
#ifndef MURMUR
-#define MURMUR 1
+#define MURMUR 2
#endif
#define MurmurMagic 0x7fd652ad
@@ -2032,7 +2032,7 @@ hash(const unsigned char * data, int len, unsigned int h)
#endif
#if MURMUR == 1
h = murmur_step(h, t);
-#elif MURMUR1 == 2
+#elif MURMUR == 2
h ^= t;
h *= MurmurMagic;
#endif