diff --git a/ChangeLog b/ChangeLog index 768a3b4967..ded918824c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Feb 28 04:03:03 2007 Yukihiro Matsumoto + + * enum.c (take_i): small cosmetic / documentation patch from + Tadashi Saito . [ruby-dev:30446] + Wed Feb 28 01:20:18 2007 NAKAMURA Usaku * test/{dbm,gdbm}/test_{dbm,gdbm}.rb: shouldn't use host_os. use diff --git a/enum.c b/enum.c index 10f07946bd..a3cb1d7c49 100644 --- a/enum.c +++ b/enum.c @@ -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); }