summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--hash.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index bc0c345f1d..994c8b362b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@ Mon Sep 24 22:14:13 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/weakref.rb (WeakRef): remove debug print. [ruby-dev:31799]
+ * hash.c (hash_i): avoid too frequent hash conflict where key and
+ value are same. a patch from Yusuke ENDOH <mame AT tsg.ne.jp>.
+ [ruby-dev:31802]
+
Mon Sep 24 17:56:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/strscan/strscan.c (strscan_initialize, strscan_getch): use the
diff --git a/hash.c b/hash.c
index 11d93af3b9..2b8d0a369e 100644
--- a/hash.c
+++ b/hash.c
@@ -1464,6 +1464,7 @@ hash_i(VALUE key, VALUE val, int *hval)
{
if (key == Qundef) return ST_CONTINUE;
*hval ^= rb_hash(key);
+ *hval *= 137;
*hval ^= rb_hash(val);
return ST_CONTINUE;
}