summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-30 03:21:56 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-30 03:21:56 (GMT)
commit54726befc3eb52bf06640bfb07664dace3721d14 (patch)
tree99766412fdcda4ec9e5d901e630475c90b56ec94 /random.c
parentf7c0cc36920a4ed14a3ab1ca6cfdf18ceff1e5d5 (diff)
use RARRAY_AREF() instead of RARRAY_CONST_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/random.c b/random.c
index fbcacca..3729756 100644
--- a/random.c
+++ b/random.c
@@ -775,19 +775,17 @@ random_load(VALUE obj, VALUE dump)
rb_random_t *rnd = get_rnd(obj);
struct MT *mt = &rnd->mt;
VALUE state, left = INT2FIX(1), seed = INT2FIX(0);
- const VALUE *ary;
unsigned long x;
rb_check_copyable(obj, dump);
Check_Type(dump, T_ARRAY);
- ary = RARRAY_CONST_PTR(dump);
switch (RARRAY_LEN(dump)) {
case 3:
- seed = ary[2];
+ seed = RARRAY_AREF(dump, 2);
case 2:
- left = ary[1];
+ left = RARRAY_AREF(dump, 1);
case 1:
- state = ary[0];
+ state = RARRAY_AREF(dump, 0);
break;
default:
rb_raise(rb_eArgError, "wrong dump data");