summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/array.c b/array.c
index e21c011..1eb1d2e 100644
--- a/array.c
+++ b/array.c
@@ -1781,8 +1781,8 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
rb_ary_modify_check(ary);
- if (argc == 1) return ary;
pos = NUM2LONG(argv[0]);
+ if (argc == 1) return ary;
if (pos == -1) {
pos = RARRAY_LEN(ary);
}