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

* enum.c (take_i): small cosmetic / documentation patch from

Tadashi Saito <shiba AT mail2.accsnet.ne.jp>. [ruby-dev:30446]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-02-27 19:04:52 +00:00
parent a17065673c
commit b2c25d56c5
2 changed files with 7 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Wed Feb 28 04:03:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* enum.c (take_i): small cosmetic / documentation patch from
Tadashi Saito <shiba AT mail2.accsnet.ne.jp>. [ruby-dev:30446]
Wed Feb 28 01:20:18 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* test/{dbm,gdbm}/test_{dbm,gdbm}.rb: shouldn't use host_os. use

8
enum.c
View file

@ -1224,8 +1224,6 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
static VALUE
take_i(VALUE i, VALUE *arg)
{
long n = arg[1];
if (arg[1]-- == 0) rb_iter_break();
rb_ary_push(arg[0], i);
return Qnil;
@ -1250,8 +1248,8 @@ take_iter_i(VALUE i, VALUE *arg)
*
* a = [1, 2, 3, 4, 5]
*
* a.take(3) # => [4, 5]
* a.take {|i| i < 3 } # => [3, 4, 5]
* a.take(3) # => [1, 2, 3]
* a.take {|i| i < 3 } # => [1, 2]
*
*/
@ -1278,8 +1276,6 @@ enum_take(int argc, VALUE *argv, VALUE obj)
static VALUE
drop_i(VALUE i, VALUE *arg)
{
long n = arg[1];
if (arg[1] == 0) {
rb_ary_push(arg[0], i);
}