diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-06 10:07:24 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-06 10:07:24 +0000 |
commit | d1521f4bb267875c9fa9eb6b5a23a81bc4a57002 (patch) | |
tree | fd5076c9ead988dee6c2320a878a386fa5aa9a8f /struct.c | |
parent | 5ef0d9c7aabf83cd2211739e6f78201bfe7e6c36 (diff) |
* struct.c (rb_struct_select): Struct#select should return
enumerator when no block given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -774,6 +774,7 @@ rb_struct_select(int argc, VALUE *argv, VALUE s) if (argc > 0) { rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc); } + RETURN_ENUMERATOR(s, 0, 0); result = rb_ary_new(); for (i = 0; i < RSTRUCT_LEN(s); i++) { if (RTEST(rb_yield(RSTRUCT_PTR(s)[i]))) { |