summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/array.c b/array.c
index 015a4ffe28..d3142c9063 100644
--- a/array.c
+++ b/array.c
@@ -631,7 +631,6 @@ VALUE
rb_ary_to_ary(obj)
VALUE obj;
{
- if (NIL_P(obj)) return rb_ary_new2(0);
if (TYPE(obj) == T_ARRAY) {
return obj;
}
@@ -649,7 +648,7 @@ rb_ary_update(ary, beg, len, rpl)
{
long rlen;
- rpl = rb_ary_to_ary(rpl);
+ rpl = (NIL_P(rpl)) ? rb_ary_new2(0) : rb_ary_to_ary(rpl);
rlen = RARRAY(rpl)->len;
if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);