* 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
This commit is contained in:
parent
0082edfd3d
commit
b6c63738b2
3
array.c
3
array.c
@ -631,7 +631,6 @@ VALUE
|
|||||||
rb_ary_to_ary(obj)
|
rb_ary_to_ary(obj)
|
||||||
VALUE obj;
|
VALUE obj;
|
||||||
{
|
{
|
||||||
if (NIL_P(obj)) return rb_ary_new2(0);
|
|
||||||
if (TYPE(obj) == T_ARRAY) {
|
if (TYPE(obj) == T_ARRAY) {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
@ -649,7 +648,7 @@ rb_ary_update(ary, beg, len, rpl)
|
|||||||
{
|
{
|
||||||
long rlen;
|
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;
|
rlen = RARRAY(rpl)->len;
|
||||||
|
|
||||||
if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
|
if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user