1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
matz 2009-10-06 10:07:24 +00:00
parent 5ef0d9c7aa
commit d1521f4bb2
2 changed files with 6 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Tue Oct 6 18:56:09 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* struct.c (rb_struct_select): Struct#select should return
enumerator when no block given.
Tue Oct 6 06:26:00 2009 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* * ext/tk/lib/tk/canvas.rb: *** POTENTIALLY INCOMPATIBLE ***

View file

@ -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]))) {