summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-24 13:18:02 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-24 13:18:02 +0000
commit5f93fa308bd970eeab9a3028c44577f0af8c636c (patch)
treee512e2dd026f5662cc0baf993355387a54c91f72 /hash.c
parentaf4310be97ccebd6c06eec164a1b197a61085032 (diff)
downloadbundler-5f93fa308bd970eeab9a3028c44577f0af8c636c.tar.gz
* 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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c1
1 files changed, 1 insertions, 0 deletions
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;
}