diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-18 06:59:04 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-18 06:59:04 +0000 |
commit | bfb47068b0a888aa82ad027aadb36828ac396683 (patch) | |
tree | 32915dbe65d750121bbde9fffb148ec19eccd945 /eval.c | |
parent | ab6963043df202bde77d67dfabff41cc3e7c11c8 (diff) | |
download | ruby-bfb47068b0a888aa82ad027aadb36828ac396683.tar.gz |
* eval.c: remove specialized version of rb_Array(). use simple
one defined in object.c.
* object.c (Init_Object): remove Kernel#to_a.
* enum.c (enum_zip): use "to_a" instead of "to_ary".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -2598,34 +2598,6 @@ avalue_splat(v) return v; } -#if 1 -VALUE -rb_Array(val) - VALUE val; -{ - VALUE tmp = rb_check_array_type(val); - - if (NIL_P(tmp)) { - /* hack to avoid invoke Object#to_a */ - VALUE origin; - ID id = rb_intern("to_a"); - - if (search_method(CLASS_OF(val), id, &origin) && - RCLASS(origin)->m_tbl != RCLASS(rb_mKernel)->m_tbl) { /* exclude Kernel#to_a */ - val = rb_funcall(val, id, 0); - if (TYPE(val) != T_ARRAY) { - rb_raise(rb_eTypeError, "`to_a' did not return Array"); - } - return val; - } - else { - return rb_ary_new3(1, val); - } - } - return tmp; -} -#endif - static VALUE splat_value(v) VALUE v; |