reverse()
public
Show source
static VALUE
rb_ary_reverse_m(VALUE ary)
{
VALUE dup = rb_ary_dup_setup(ary);
long len = RARRAY_LEN(ary);
if (len > 0) {
VALUE *p1 = RARRAY_PTR(ary);
VALUE *p2 = RARRAY_PTR(dup) + len - 1;
do *p2-- = *p1++; while (--len > 0);
}
return dup;
}