summaryrefslogtreecommitdiffstats
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
commitb262c0f288e719f91978bf28540e472761db4c7f (patch)
tree77417603b77ac36ff0ffabf339aa5a6bd4124783
parent34b911fe1c0b3cebcb2a8a7b6a8d883b9161389e (diff)
downloadruby-b262c0f288e719f91978bf28540e472761db4c7f.tar.gz
ruby-b262c0f288e719f91978bf28540e472761db4c7f.tar.xz
ruby-b262c0f288e719f91978bf28540e472761db4c7f.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@21785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--hash.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index bef9e8538..85f0377b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jan 27 03:43:34 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * hash.c (rb_any_hash): fixed performance issues with nil, true,
+ false as hash keys. a patch from Matthias Waechter.
+ [ruby-core:21568]
+
Tue Jan 27 03:23:43 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/mkmf.rb (create_makefile): should point correct path to
diff --git a/hash.c b/hash.c
index 7203d8c4e..bfd3fe7f6 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;