Project

General

Profile

Bug #1554 » enum_first_19.patch

marcandre (Marc-Andre Lafortune), 06/02/2009 05:38 AM

View differences:

enum.c (working copy)
else {
long n = NUM2LONG(ary[0]);
rb_ary_push(ary[1], i);
n--;
if (n <= 0) {
rb_iter_break();
}
rb_ary_push(ary[1], i);
n--;
ary[0] = INT2NUM(n);
}
return Qnil;
......
ary[0] = ary[1] = Qnil;
}
else {
long len;
rb_scan_args(argc, argv, "01", &n);
ary[0] = n;
ary[1] = rb_ary_new2(NUM2LONG(n));
len = NUM2LONG(n);
if (len == 0) return rb_ary_new2(0);
ary[0] = INT2NUM(len);
ary[1] = rb_ary_new2(len);
}
rb_block_call(obj, id_each, 0, 0, first_i, (VALUE)ary);
(1-1/2)