зеркало из https://github.com/github/ruby.git
* enum.c (enum_take_while): returns Enumerator if no block given.
* enum.c (enum_drop_while): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
efedaa432b
Коммит
58c070aa9b
|
@ -1,3 +1,9 @@
|
||||||
|
Fri Nov 30 16:42:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* enum.c (enum_take_while): returns Enumerator if no block given.
|
||||||
|
|
||||||
|
* enum.c (enum_drop_while): ditto.
|
||||||
|
|
||||||
Thu Nov 29 16:59:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Nov 29 16:59:10 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]
|
* parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]
|
||||||
|
|
2
enum.c
2
enum.c
|
@ -1451,6 +1451,7 @@ enum_take_while(VALUE obj)
|
||||||
{
|
{
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
|
|
||||||
|
RETURN_ENUMERATOR(obj, 0, 0);
|
||||||
ary = rb_ary_new();
|
ary = rb_ary_new();
|
||||||
rb_block_call(obj, id_each, 0, 0, take_while_i, (VALUE)&ary);
|
rb_block_call(obj, id_each, 0, 0, take_while_i, (VALUE)&ary);
|
||||||
return ary;
|
return ary;
|
||||||
|
@ -1522,6 +1523,7 @@ enum_drop_while(VALUE obj)
|
||||||
{
|
{
|
||||||
VALUE args[2];
|
VALUE args[2];
|
||||||
|
|
||||||
|
RETURN_ENUMERATOR(obj, 0, 0);
|
||||||
args[0] = rb_ary_new();
|
args[0] = rb_ary_new();
|
||||||
args[1] = Qfalse;
|
args[1] = Qfalse;
|
||||||
rb_block_call(obj, id_each, 0, 0, drop_while_i, (VALUE)args);
|
rb_block_call(obj, id_each, 0, 0, drop_while_i, (VALUE)args);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче