From f2bc7c305a37ee61651d8296b1a4f899fe0689af Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 30 Jun 2022 10:09:34 +0900 Subject: [PATCH] array.c (mrb_assoc_new): keep pointer in a local variable. The optimizer may do the same, but tried to make it clear. --- src/array.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/array.c b/src/array.c index 548416250..227d8a734 100644 --- a/src/array.c +++ b/src/array.c @@ -112,10 +112,12 @@ MRB_API mrb_value mrb_assoc_new(mrb_state *mrb, mrb_value car, mrb_value cdr) { struct RArray *a; + mrb_value *p; a = ary_new_capa(mrb, 2); - ARY_PTR(a)[0] = car; - ARY_PTR(a)[1] = cdr; + p = ARY_PTR(a); + p[0] = car; + p[1] = cdr; ARY_SET_LEN(a, 2); return mrb_obj_value(a); }