diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-27 07:11:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-27 07:11:49 +0000 |
commit | f01cef2050bdc52f580897aaae15564ee01ff2b0 (patch) | |
tree | 79e49f666cf81f208d6537d700123979bb962f91 /vm_insnhelper.c | |
parent | b3392daaadcbec9a2ab10824f207f72f49056ec3 (diff) | |
download | ruby-f01cef2050bdc52f580897aaae15564ee01ff2b0.tar.gz |
vm_insnhelper.c: reduce duplication
* vm_insnhelper.c (vm_search_method): reduce duplicated code for the
case cache does not hit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index f33b872527..4b8b2a2334 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -850,17 +850,14 @@ vm_search_method(rb_call_info_t *ci, VALUE recv) #if OPT_INLINE_METHOD_CACHE if (LIKELY(GET_VM_STATE_VERSION() == ci->vmstat && klass == ci->klass)) { /* cache hit! */ + return; } - else { - ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class); - ci->klass = klass; - ci->vmstat = GET_VM_STATE_VERSION(); - ci->call = vm_call_general; - } -#else +#endif ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class); ci->call = vm_call_general; ci->klass = klass; +#if OPT_INLINE_METHOD_CACHE + ci->vmstat = GET_VM_STATE_VERSION(); #endif } |