summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-06 06:52:37 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-06 06:52:37 (GMT)
commit3377db6b32665b0e1eb5fa19651f4e3e2272282f (patch)
tree41e479155b959d78ccd1ea9b8f37860017832a10 /random.c
parent0e303494d099a3d76acbca061ceb3cee5f1dc44b (diff)
random.c: use rb_check_to_int
* random.c (rand_range, rand_random): use rb_check_to_int instead of rb_check_to_integer with the same conversion method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/random.c b/random.c
index 849c8c5..17aa532 100644
--- a/random.c
+++ b/random.c
@@ -1170,7 +1170,7 @@ rand_range(VALUE obj, rb_random_t* rnd, VALUE range)
if ((v = vmax = range_values(range, &beg, &end, &excl)) == Qfalse)
return Qfalse;
- if (!RB_TYPE_P(vmax, T_FLOAT) && (v = rb_check_to_integer(vmax, "to_int"), !NIL_P(v))) {
+ if (!RB_TYPE_P(vmax, T_FLOAT) && (v = rb_check_to_int(vmax), !NIL_P(v))) {
long max;
vmax = v;
v = Qnil;
@@ -1293,7 +1293,7 @@ rand_random(int argc, VALUE *argv, VALUE obj, rb_random_t *rnd)
if (NIL_P(vmax)) {
v = Qnil;
}
- else if (!RB_TYPE_P(vmax, T_FLOAT) && (v = rb_check_to_integer(vmax, "to_int"), !NIL_P(v))) {
+ else if (!RB_TYPE_P(vmax, T_FLOAT) && (v = rb_check_to_int(vmax), !NIL_P(v))) {
v = rand_int(obj, rnd, v, 1);
}
else if (v = rb_check_to_float(vmax), !NIL_P(v)) {