Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

raise ArgumentError on nil

  • Loading branch information...
commit 90a88631ef3da0c820adb7779dab27c723f8caba 1 parent 475e6cf
@Watson1978 Watson1978 authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  random.c
View
3  random.c
@@ -683,7 +683,6 @@ random_rand(VALUE obj, SEL sel, int argc, VALUE *argv)
int excl = 0;
if (argc == 0) {
-zero_arg:
return rb_float_new(genrand_real(&rnd->mt));
}
else if (argc != 1) {
@@ -691,7 +690,7 @@ random_rand(VALUE obj, SEL sel, int argc, VALUE *argv)
}
VALUE vmax = argv[0];
if (NIL_P(vmax)) {
- goto zero_arg;
+ v = Qnil;
}
else if (TYPE(vmax) != T_FLOAT
&& (v = rb_check_to_integer(vmax, "to_int"), !NIL_P(v))) {
Please sign in to comment.
Something went wrong with that request. Please try again.