diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-04 01:12:53 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-04 01:12:53 +0000 |
commit | 493804573589416bb3436ecf25fb44c6f83a9c1e (patch) | |
tree | 2af43f7e5bb5b8e65b6f9ab2751b4ffc74161115 /vm_insnhelper.c | |
parent | 0ee5c55e51f0d4c0a7170b7985d3cb9d361be98e (diff) | |
download | ruby-493804573589416bb3436ecf25fb44c6f83a9c1e.tar.gz |
variable: cleanup to use rb_const_lookup
* variable.c: cleanup to use rb_const_lookup
* vm_insnshelper.c: ditto
This reduces casting and long lines. This should make it easier to
switch to alternatives to st for constant storage.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index e899c1b6b4..2c43e06f63 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -394,11 +394,10 @@ vm_get_ev_const(rb_thread_t *th, const rb_iseq_t *iseq, if (!NIL_P(klass)) { VALUE av, am = 0; - st_data_t data; + rb_const_entry_t *ce; search_continue: - if (RCLASS_CONST_TBL(klass) && - st_lookup(RCLASS_CONST_TBL(klass), id, &data)) { - val = ((rb_const_entry_t*)data)->value; + if ((ce = rb_const_lookup(klass, id))) { + val = ce->value; if (val == Qundef) { if (am == klass) break; am = klass; |