diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-24 04:29:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-24 04:29:07 +0000 |
commit | d03199b6d6cedc9c5d1059aa58e5211af6b479b3 (patch) | |
tree | 567b4463c00d4aea8411be514d9fc1d003542114 /object.c | |
parent | 498838c6627c82befd3c6dcd5c5d6870b38db5e7 (diff) | |
download | ruby-d03199b6d6cedc9c5d1059aa58e5211af6b479b3.tar.gz |
* object.c (rb_Hash): trivial optimization.
* test/ruby/test_object.rb (TestObject#test_convert_hash): fix
arguments order.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2600,7 +2600,7 @@ rb_Hash(VALUE val) if (NIL_P(val)) return rb_hash_new(); VALUE tmp = rb_check_hash_type(val); if (NIL_P(tmp)) { - if (TYPE(val) == T_ARRAY && RARRAY_LEN(val) == 0) + if (RB_TYPE_P(val, T_ARRAY) && RARRAY_LEN(val) == 0) return rb_hash_new(); rb_raise(rb_eTypeError, "can't convert %s into Hash", rb_obj_classname(val)); } |