summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-29 18:00:02 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-29 18:00:02 (GMT)
commitd3edfdc7d9cadd6c8e7f7b7c93729da5c5cf4542 (patch)
tree888e3a88f6d9ddb746ddebff0f42e7bd1041e630 /enum.c
parentd36ab02b9589ba7b95656719f81a5292d259d4fb (diff)
use RARRAY_AREF() instead of RARRAY_CONST_PTR().
* class.c (rb_keyword_error_new): use RARRAY_AREF() because RARRAY_CONST_PTR() can introduce additional overhead in a futre. Same fixes for other files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/enum.c b/enum.c
index 0cecb7d..9485b7e 100644
--- a/enum.c
+++ b/enum.c
@@ -744,7 +744,8 @@ ary_inject_op(VALUE ary, VALUE init, VALUE op)
}
}
for (; i < RARRAY_LEN(ary); i++) {
- v = rb_funcallv_public(v, id, 1, &RARRAY_CONST_PTR(ary)[i]);
+ VALUE arg = RARRAY_AREF(ary, i);
+ v = rb_funcallv_public(v, id, 1, &arg);
}
return v;
}