mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
minor bug fixes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
edbe98d848
commit
a84982e129
2 changed files with 3 additions and 5 deletions
6
array.c
6
array.c
|
@ -1275,7 +1275,7 @@ rb_ary_slice_bang(argc, argv, ary)
|
||||||
if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) {
|
if (rb_scan_args(argc, argv, "11", &arg1, &arg2) == 2) {
|
||||||
pos = NUM2LONG(arg1);
|
pos = NUM2LONG(arg1);
|
||||||
len = NUM2LONG(arg2);
|
len = NUM2LONG(arg2);
|
||||||
delete_pos_len:
|
delete_pos_len:
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
pos = RARRAY(ary)->len + pos;
|
pos = RARRAY(ary)->len + pos;
|
||||||
}
|
}
|
||||||
|
@ -1288,9 +1288,7 @@ delete_pos_len:
|
||||||
goto delete_pos_len;
|
goto delete_pos_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_ary_delete_at(ary, NUM2LONG(arg1));
|
return rb_ary_delete_at(ary, NUM2LONG(arg1));
|
||||||
|
|
||||||
return arg2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
2
compar.c
2
compar.c
|
@ -22,7 +22,7 @@ cmp_equal(x, y)
|
||||||
{
|
{
|
||||||
VALUE c = rb_funcall(x, cmp, 1, y);
|
VALUE c = rb_funcall(x, cmp, 1, y);
|
||||||
|
|
||||||
if (NIL_P(c)) return Qnil;
|
if (NIL_P(c)) return Qfalse;
|
||||||
if (NUM2LONG(c) == 0) return Qtrue;
|
if (NUM2LONG(c) == 0) return Qtrue;
|
||||||
return Qfalse;
|
return Qfalse;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue