summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-26 18:48:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-26 18:48:47 +0000
commitad049bc5df91104e0d59e014b2b244b47694d2ef (patch)
tree77417603b77ac36ff0ffabf339aa5a6bd4124783 /hash.c
parentf327dd57bb9da29ed3ad74dbec2af3854d2906db (diff)
* hash.c (rb_any_hash): fixed performance issues with nil, true,
false as hash keys. a patch from Matthias Waechter. [ruby-core:21568] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 7203d8c4e9..bfd3fe7f61 100644
--- a/hash.c
+++ b/hash.c
@@ -69,6 +69,9 @@ rb_any_hash(VALUE a)
switch (TYPE(a)) {
case T_FIXNUM:
case T_SYMBOL:
+ case T_NIL:
+ case T_FALSE:
+ case T_TRUE:
hnum = (int)a;
break;