Created
September 17, 2015 15:24
-
-
Save pimeys/1594c47253d131b66763 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static VALUE | |
rb_ary_flatten(int argc, VALUE *argv, VALUE ary) | |
{ | |
int mod = 0, level = -1; | |
VALUE result, lv; | |
rb_scan_args(argc, argv, "01", &lv); | |
if (!NIL_P(lv)) level = NUM2INT(lv); | |
if (level == 0) return ary_make_shared_copy(ary); | |
result = flatten(ary, level, &mod); | |
OBJ_INFECT(result, ary); | |
return result; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment