mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* object.c (rb_Hash): fix mixed declaration and code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e187c4ca1f
commit
abd135d36b
1 changed files with 3 additions and 1 deletions
4
object.c
4
object.c
|
@ -2597,8 +2597,10 @@ rb_f_array(VALUE obj, VALUE arg)
|
|||
VALUE
|
||||
rb_Hash(VALUE val)
|
||||
{
|
||||
VALUE tmp;
|
||||
|
||||
if (NIL_P(val)) return rb_hash_new();
|
||||
VALUE tmp = rb_check_hash_type(val);
|
||||
tmp = rb_check_hash_type(val);
|
||||
if (NIL_P(tmp)) {
|
||||
if (RB_TYPE_P(val, T_ARRAY) && RARRAY_LEN(val) == 0)
|
||||
return rb_hash_new();
|
||||
|
|
Loading…
Reference in a new issue