summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/array.c b/array.c
index 7e9dcfa073..41a94783fb 100644
--- a/array.c
+++ b/array.c
@@ -3030,8 +3030,8 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
VALUE num;
long r, n, i;
- RETURN_ENUMERATOR(ary, argc, argv); /* Return enumerator if no block */
n = RARRAY_LEN(ary); /* Array length */
+ RETURN_ENUMERATOR(ary, argc, argv); /* Return enumerator if no block */
rb_scan_args(argc, argv, "01", &num);
r = NIL_P(num) ? n : NUM2LONG(num); /* Permutation size from argument */
@@ -3111,8 +3111,8 @@ rb_ary_combination(VALUE ary, VALUE num)
{
long n, i, len;
- RETURN_ENUMERATOR(ary, 1, &num);
n = NUM2LONG(num);
+ RETURN_ENUMERATOR(ary, 1, &num);
len = RARRAY_LEN(ary);
if (n < 0 || len < n) {
/* yield nothing */