From fa043eb4e8764902beb1ff1e89ef6af98e6d7725 Mon Sep 17 00:00:00 2001 From: normal Date: Sat, 8 Mar 2014 08:56:50 +0000 Subject: vm.c: cleanup to use rb_method_entry_at * vm.c (add_opt_method): cleanup to use rb_method_entry_at Easier experiments with a non-st method entry tables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index 08c96d5393..d9ac0284f8 100644 --- a/vm.c +++ b/vm.c @@ -1147,8 +1147,9 @@ rb_vm_check_redefinition_by_prepend(VALUE klass) static void add_opt_method(VALUE klass, ID mid, VALUE bop) { - rb_method_entry_t *me; - if (st_lookup(RCLASS_M_TBL(klass), mid, (void *)&me) && me->def && + rb_method_entry_t *me = rb_method_entry_at(klass, mid); + + if (me && me->def && me->def->type == VM_METHOD_TYPE_CFUNC) { st_insert(vm_opt_method_table, (st_data_t)me, (st_data_t)bop); } -- cgit v1.2.3