summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-01 03:40:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-01 03:40:01 +0000
commitb6c63738b24548fa265c2da72856151c961a5426 (patch)
tree7d446c6d1747923d96f21e3de8c67918db9b6e17
parent0082edfd3d4c0288cf8464fac54d7655db5a29ca (diff)
* eval.c (massign): removed awkward conversion between yvalue,
mvalue, etc. * eval.c (rb_yield_0): new parameter added to tell whether val is an array value or not. * parse.y (yield_args): restructuring: new nodes: NODE_RESTARY2, NODE_SVALUE; removed node: NODE_RESTARGS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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);