mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
random.c: fix fallback value
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1f71ea2fd2
commit
a354992688
1 changed files with 2 additions and 4 deletions
6
random.c
6
random.c
|
@ -1160,14 +1160,12 @@ random_s_bytes(VALUE obj, VALUE len)
|
|||
static VALUE
|
||||
range_values(VALUE vmax, VALUE *begp, VALUE *endp, int *exclp)
|
||||
{
|
||||
VALUE end, r;
|
||||
VALUE end;
|
||||
|
||||
if (!rb_range_values(vmax, begp, &end, exclp)) return Qfalse;
|
||||
if (endp) *endp = end;
|
||||
if (NIL_P(end)) return Qnil;
|
||||
r = rb_check_funcall(end, id_minus, 1, begp);
|
||||
if (NIL_P(r)) return Qfalse;
|
||||
return r;
|
||||
return rb_check_funcall_default(end, id_minus, 1, begp, Qfalse);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
Loading…
Add table
Reference in a new issue