Skip to content

Instantly share code, notes, and snippets.

@tmacedo
Created February 13, 2012 16:39
Show Gist options
  • Save tmacedo/1818057 to your computer and use it in GitHub Desktop.
Save tmacedo/1818057 to your computer and use it in GitHub Desktop.
VALUE
rb_ary_each(VALUE array)
{
long i;
volatile VALUE ary = array;
RETURN_ENUMERATOR(ary, 0, 0);
for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(RARRAY_PTR(ary)[i]);
}
return ary;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment