summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-13 03:38:18 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-13 03:38:18 +0000
commit387c7137862836c24daf00233d295b49104a0a16 (patch)
tree2c2b60c55493a1025ca4409108e81cca93e91874 /array.c
parent074be09a9f63e4c0aa38cff5d16c37c9026aac3f (diff)
* array.c (rb_ary_select): can remove argc check. [ruby-core:4911]
(patch from Daniel Berger) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/array.c b/array.c
index 418cc97..8a6f585 100644
--- a/array.c
+++ b/array.c
@@ -1799,17 +1799,12 @@ rb_ary_values_at(argc, argv, ary)
*/
static VALUE
-rb_ary_select(argc, argv, ary)
- int argc;
- VALUE *argv;
+rb_ary_select(ary)
VALUE ary;
{
VALUE result;
long i;
- if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
- }
result = rb_ary_new2(RARRAY(ary)->len);
for (i = 0; i < RARRAY(ary)->len; i++) {
if (RTEST(rb_yield(RARRAY(ary)->ptr[i]))) {
@@ -3017,7 +3012,7 @@ Init_Array()
rb_define_method(rb_cArray, "collect!", rb_ary_collect_bang, 0);
rb_define_method(rb_cArray, "map", rb_ary_collect, 0);
rb_define_method(rb_cArray, "map!", rb_ary_collect_bang, 0);
- rb_define_method(rb_cArray, "select", rb_ary_select, -1);
+ rb_define_method(rb_cArray, "select", rb_ary_select, 0);
rb_define_method(rb_cArray, "values_at", rb_ary_values_at, -1);
rb_define_method(rb_cArray, "delete", rb_ary_delete, 1);
rb_define_method(rb_cArray, "delete_at", rb_ary_delete_at_m, 1);