remove mrb_define_method_vm() function

It isn't needed as it's very similar to mrb_define_method_raw() and also
there's only one place where mrb_proc_ptr() actually has to be called.

Inspired by @furunkel's method cache patch (#2764).
This commit is contained in:
cremno
2015-05-15 13:04:55 +02:00
parent bc8308ba8d
commit 2106d4d446
3 changed files with 4 additions and 23 deletions
+2 -1
View File
@@ -2303,8 +2303,9 @@ RETRY_TRY_BLOCK:
/* A B R(A).newmethod(Syms(B),R(A+1)) */
int a = GETARG_A(i);
struct RClass *c = mrb_class_ptr(regs[a]);
struct RProc *p = mrb_proc_ptr(regs[a+1]);
mrb_define_method_vm(mrb, c, syms[GETARG_B(i)], regs[a+1]);
mrb_define_method_raw(mrb, c, syms[GETARG_B(i)], p);
ARENA_RESTORE(mrb, ai);
NEXT;
}