reverse_each(...)
public
Traverses enum in reverse order.
Show source
/*
* call-seq:
* enum.reverse_each {|item| block }
*
* Traverses <i>enum</i> in reverse order.
*/
static VALUE
enum_reverse_each(int argc, VALUE *argv, VALUE obj)
{
VALUE ary;
long i;
RETURN_ENUMERATOR(obj, argc, argv);
ary = enum_to_a(argc, argv, obj);
for (i = RARRAY_LEN(ary); --i >= 0; ) {
rb_yield(RARRAY_PTR(ary)[i]);
}
return obj;
}