codegen.c: generate `OP_SETIDX`; close
Note that the current implantation only calls `[]=` method. No
performance improvement. Just 2 bytes less byte code per assignment.
MODIFY
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
@@ -1750,6 +1750,9 @@ gen_call(codegen_scope *s, node *tree, mrb_sym name, int sp, int val, int safe)
else if (!noop && sym == MRB_OPSYM_2(s->mrb, eq) && n == 1) {
genop_1(s, OP_EQ, cursp());
}
+ else if (!noop && sym == MRB_OPSYM_2(s->mrb, aset) && n == 2) {
+ genop_1(s, OP_SETIDX, cursp());
+ }
else if (!noop && n == 0 && gen_uniop(s, sym, cursp())) {
/* constant folding succeeded */
}

codegen.c: generate `OP_SETIDX`; close #5608

Note that the current implantation only calls `[]=` method. No
performance improvement. Just 2 bytes less byte code per assignment.