mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
RARRAY_AREF: convert into an inline function
RARRAY_AREF has been a macro for reasons. We might not be able to change that for public APIs, but why not relax the situation internally to make it an inline function.
This commit is contained in:
parent
72d0f2f0e0
commit
ff30358d13
Notes:
git
2020-08-15 12:09:51 +09:00
12 changed files with 34 additions and 17 deletions
|
@ -100,4 +100,15 @@ RARY_TRANSIENT_UNSET(VALUE ary)
|
|||
})
|
||||
#endif
|
||||
|
||||
#undef RARRAY_AREF
|
||||
RBIMPL_ATTR_PURE_UNLESS_DEBUG()
|
||||
RBIMPL_ATTR_ARTIFICIAL()
|
||||
static inline VALUE
|
||||
RARRAY_AREF(VALUE ary, long i)
|
||||
{
|
||||
RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY);
|
||||
|
||||
return RARRAY_CONST_PTR_TRANSIENT(ary)[i];
|
||||
}
|
||||
|
||||
#endif /* INTERNAL_ARRAY_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue