Skip to content
Permalink
Browse files
Reduce object allocation
  • Loading branch information
ksss committed Apr 2, 2017
1 parent be5c304 commit 7f983928b938b25ca24439686bfa88fdfbe06f67
Showing 1 changed file with 3 additions and 2 deletions.
@@ -110,7 +110,7 @@ mrb_proc_parameters(mrb_state *mrb, mrb_value self)
const struct RProc *proc = mrb_proc_ptr(self);
const struct mrb_irep *irep = proc->body.irep;
mrb_aspec aspec;
mrb_value parameters;
mrb_value sname, parameters;
int i, j;

if (MRB_PROC_CFUNC_P(proc)) {
@@ -142,7 +142,8 @@ mrb_proc_parameters(mrb_state *mrb, mrb_value self)
parameters = mrb_ary_new_capa(mrb, irep->nlocals-1);

for (i = 0, p = parameters_list; p->name; p++) {
mrb_value sname = mrb_symbol_value(mrb_intern_cstr(mrb, p->name));
if (p->size <= 0) continue;
sname = mrb_symbol_value(mrb_intern_cstr(mrb, p->name));
for (j = 0; j < p->size; i++, j++) {
mrb_value a = mrb_ary_new(mrb);
mrb_ary_push(mrb, a, sname);

0 comments on commit 7f98392

Please sign in to comment.