From ff30358d13d24d8202f2717c43700be70bdd49d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Fri, 14 Aug 2020 14:45:23 +0900 Subject: 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. --- enumerator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'enumerator.c') diff --git a/enumerator.c b/enumerator.c index 77cf565eec..3ea308a7cd 100644 --- a/enumerator.c +++ b/enumerator.c @@ -2087,7 +2087,8 @@ lazy_flat_map_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo long i; LAZY_MEMO_RESET_BREAK(result); for (i = 0; i + 1 < RARRAY_LEN(ary); i++) { - lazy_yielder_yield(result, proc_index, 1, &RARRAY_AREF(ary, i)); + const VALUE argv = RARRAY_AREF(ary, i); + lazy_yielder_yield(result, proc_index, 1, &argv); } if (break_p) LAZY_MEMO_SET_BREAK(result); if (i >= RARRAY_LEN(ary)) return 0; -- cgit v1.2.3